Screen scraper via AJAX and javascript

I want to clear the screen using AJAX and javascript. How is this possible?

This needs to be cleared: http://www.fedex.com/Tracking?ascend_header=1&clienttype=dotcom&cntry_code=us&language=english&tracknumbers=776812461212825

I used the method listed at w3school.com but showing "access denied". Why is "access denied" displayed? Please solve my problem.

Thanks in advance.

+1


source to share


3 answers


If you clear your screen trying to access the FedEx url directly from your Javascript / website on your own domain, that is your problem. If you really want to do this, the easiest way would be to make an AJAX script call somewhere on your domain and make a tracking request for you.



Check out this information about creating a proxy.

+4


source


Based on Beau Simensen's answer, you can make an Ajax call to your domain:

Ajax.Request("http://mydomain.com/proxy.php?url=http://www.fedex.com/Tracking?ascend_header=1&clienttype=dotcom&cntry_code=us&language=english&tracknumbers=776812461212825");

      



The proxy.php file will simply make a CURL request (or whatever) to the supplied url parameter and return its result, so you can access all sites in your local domain through that proxy.php.

+2


source


Ajax / XMLHttpRequest calls are restricted to the same site policy for security reasons; you cannot use them to directly download remote sites. Firefox 3.1 explicitly added support for cross-site requests, but I haven't heard any other browsers jumped.

+1


source







All Articles