views:

175

answers:

2

Hi friends,

I want to parse a web page into my page, so i prefer AJAX in my code. While using the AJAX it showing "Access denied" - before fetching the specified page. The page doesn't consider any login information.

Even though i cant able to get the page of google too..

Please guide me to how to use the AJAX so for

Thanks,
Praveen

+7  A: 

you can send xmlhttp requests only to your domain. if your site is example.com you can send xmlhttp requests only to example.com Firefox 3 supports cross domain requests but you need to send Access-Control first.

Solution is to send request to your domain and fetch cross domain content via some server language (java, php, python, etc.)

Ivan
+1 Simple and clearly explained :)
Shoban
yes u r right! clearly explained.. thanks
praveenjayapal
loading data by inserting a script node gets around the x-domain problem too, at least for GET requests
annakata
not script but iframe in this case, (praveenjayapal needs html), but this may bring other problems :)
Ivan
A: 

You can also use a hack to retrieve data through a CSS include http://nb.io/hacks/csshttprequest