全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:2162
推到 Plurk!
推到 Facebook!

idhttp中如何處理javascript方式的頁面轉向呢?

尚未結案
linxi
一般會員


發表:17
回覆:15
積分:6
註冊:2004-08-29

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-09-23 10:30:00 IP:218.8.xxx.xxx 未訂閱
我最近在做一個個類似瀏覽器的東西,用的是idhttp物件,我將HandleRedirects 屬性設置為true,但是當遇到非302方式的頁面轉向時,就無法轉向正確的網頁,例如碰到下面的javascript 頁面,瀏覽器就停止了,要如何才能到達正確的頁面呢?    <head> <!-- //window.history.back(2); window.history.forward(1); function clicktoit () { document.forms[0].submit(); } //--> </head><body > <form action="/3.php"> <input type=hidden name="time" value="1095902685"> <input type=hidden name="check" value="379b2e9b965a9f0e01199afd28266532"> <input type=hidden name="sid" value="1942"><input type=hidden name="goto" value="70122e85dc356ee63f4055cad24108c2-MTA5NTkwMjYzOQkyNC4xODYuOTcuMjUyCQlwX3JzMDEJMTk0Mgl3YXRjaGVzCWthbm9vZGxlCWh0dHA6Ly93d3cua2Fub29kbGUuY29tL2NsaWNrdGhyb3VnaC5jb29sP3Bvc2l0aW9uPTcwMDEmdGlkPWJobmdicG5sYnBuZ2Jpbm1ibG5oemRvenhhcmR4YyZiaWQ9MC4xMSZlaWQ9MSZpZD03MzQ3NzM1MSZxdWVyeT13YXRjaGVzJmNsaWNraWQ9NDMxNzgyMzQmVU5RPTAwMTA5NTkwMjY1MTgxNzYyODQ1JnN1YmlkPTgwNjQ0MDQ4CTAuMDcJMAkxCQk="><input type=hidden name="referrer" value=""><noscript><input type="submit" value="Click here to redirect to this website."></noscript></form></body
wameng
版主


發表:31
回覆:1336
積分:1188
註冊:2004-09-16

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-09-23 11:36:49 IP:61.222.xxx.xxx 未訂閱
Redirection ResponseCodes include the following: 300 - Multiple Choices. The request can be fulfilled with one of a set of resources, each with its own specific location. The HTTP client can select a preferred representation and redirect its request to that location. 301 - Moved Permanently. The requested resource has been assigned a new permanent URI and any future references to this resource should use the new location specified in the Response. 302 - Found. The requested resource resides temporarily under a different URI. Since the redirection might be altered on occasion, the client should continue to use the URI in the Request for future requests. 304 - Not Modified. If the client has performed a conditional GET request and access is allowed, but the document has not been modified, the server should respond with this status code. The 304 response should not contain a message body, and is always terminated by the first empty line after the header fields, and must include a Date header. 305 - Use Proxy. The requested resource must be accessed through the proxy given by the Location header in the HTTP Response containing the URI of the Proxy. 307 - Temporary Redirect. The requested resource resides temporarily under a different URI. Since the redirection may be altered on occasion, the HTTP client should continue to use the URI in the RequestI for future requests. 非 302 HandleRedirects 無法自動轉吧! 我覺得自己寫程式判斷就可以了!
linxi
一般會員


發表:17
回覆:15
積分:6
註冊:2004-08-29

發送簡訊給我
#3 引用回覆 回覆 發表時間:2004-09-23 14:46:36 IP:218.8.xxx.xxx 未訂閱
謝謝wameng,我想知道的是javascript 當中如果進行頁面的轉向,就向下面這段網頁代碼,要如何處理? 不好意思,我貼上的 html 代碼要怎樣才能原樣顯示出來,我已經貼上了,可以看不到,是哪裡不對? 發表人 - linxi 於 2004/09/23 15:02:03
wameng
版主


發表:31
回覆:1336
積分:1188
註冊:2004-09-16

發送簡訊給我
#4 引用回覆 回覆 發表時間:2004-09-23 15:09:14 IP:61.222.xxx.xxx 未訂閱
我的意思是 在下載的 Http.Body 用 POS('javaScr...',Httpbody)的方式。
timhuang
尊榮會員


發表:78
回覆:1815
積分:1608
註冊:2002-07-15

發送簡訊給我
#5 引用回覆 回覆 發表時間:2004-09-23 16:29:20 IP:203.95.xxx.xxx 未訂閱
Hi, 使用 javascript 來操作時, 是給 browser 看的 script, 若只是使用 idhttp 元件來取得資料的話, 必須要自行解譯 script 才行, 模擬你要做轉址的行為, 若是可以的話, 使用 TWebBrowser 來操作應該會比使用 idhttp 來得容易, 因為該元件就是一個 browser !!
系統時間:2024-11-22 10:28:07
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!