What i'm wondering is if there's any way to get xml file data from a -> xmlhttp.open("GET","http://www.website.com/file.xml",false);
than xmlhttp.open("GET","file.xml",false); ?
| SitePoint Sponsor |
What i'm wondering is if there's any way to get xml file data from a -> xmlhttp.open("GET","http://www.website.com/file.xml",false);
than xmlhttp.open("GET","file.xml",false); ?
The current code isand it works, but when i enterCode:xmlhttp.open("GET","http://www.mysite.com/xml/file.xml",false); xmlhttp.send();it doesnt show any content.Code:xmlhttp.open("GET","http://www.someothersite.com/directoryxxx/file.xml",false); xmlhttp.send();
Can anyone please help, on this or is it possible to show content from xml content from different location other than local?


AJAX has same domain restrictions for security reasons.
Maybe you can do something server-side? Maybe using CURL?
thanks for answering. Restrictions might explain but, i have no idea on how to use CURL for that. I googled but it's still confusing.


What are you using server side, PHP?
If so, and if the allow_url_fopen settng is enabled you should have a few options.
*note: - to find out you can run
HTML Code:<?php phpinfo(); ?>
Yes, i'm using php and the allow_url_fopen is enabled.
I got it to work by making everything in php.
I called the xml data through php not html and javascript and it all works.
Only thing i need to find out no is how to display top 10 results of xml.
Thanks for help.
Bookmarks