SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    May 2005
    Location
    london uk
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    XMLHTTPRequest cross domain security problem

    hello,

    Im working on a website which will produce a XML feed to be displayed in several other websites. This sites will have a javascript which i have already made using DOM to make a table with contents from the feed.

    All was going fine while developing and testing in my local machine, but when i uploaded the xml to the production server the problems started.

    in mozilla based browsers it's denying permission at client side to open the feed and internet explorer promts a nasty security warning. To my understanding this happens because the function doesn't work for a feed which is not on the same domain as the javascript.

    is there any work around for this issue?

    any advice would be much appreciated.

    regards

  2. #2
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Server side. Do a request for get.php?url=whatever you want, and have get.php simply echo file_get_contents($_GET['url']);

  3. #3
    SitePoint Member
    Join Date
    May 2005
    Location
    london uk
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for your reply. in this case the get.php file would have to reside in the site of whom ever wants to use the xml feed of my server, corrrect? because that is the issue, i have no control over the sites of the people who want to use the script, thats why i wanted to use the xml parsing in javascript, so it wouldn't be depended on the users server technology and wouldn't require any processing at my server side as well.

  4. #4
    SitePoint Member
    Join Date
    Jan 2003
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There's a way to solve this using mod_rewrite if you want: http://www.livejournal.com/users/premshree/66129.html


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
  •