Connecting Tech Pros Worldwide Forums | Help | Site Map

3rd party page access from JavaScript. Is this possible?

Mike Harrison
Guest
 
Posts: n/a
#1: Nov 20 '08
Hi, is it possible to do something like this using JavaScript?

My page should prompt the user for a 3rd party URL. It will then
validate this URL, request the page, analyse it and update the main
page with the results of the analysis.

I can load the 3rd party page into an iframe no problem, but I'm
unable to access the document source because it's come from a
different domain. This domain is out of my control.

Is there any way to do this using client side technology? I realise I
could do this on the server and update the page using AJAX, but I
specifically need the client to request the page, not the server.

Is there another angle I could approach this from? I just need read-
only access to the page source, which will be standard HTML. The page
itself doesn't need to be displayed to the user.

Many thanks.

David Mark
Guest
 
Posts: n/a
#2: Nov 20 '08

re: 3rd party page access from JavaScript. Is this possible?


On Nov 20, 7:33*am, Mike Harrison <mjh...@yahoo.co.ukwrote:
Quote:
Hi, is it possible to do something like this using JavaScript?
>
My page should prompt the user for a 3rd party URL. It will then
validate this URL, request the page, analyse it and update the main
page with the results of the analysis.
>
I can load the 3rd party page into an iframe no problem, but I'm
unable to access the document source because it's come from a
different domain. This domain is out of my control.
>
Is there any way to do this using client side technology? I realise I
No. I think IE has a security setting to explicitly allow it, but it
will be hard to get your users to set it.
Quote:
could do this on the server and update the page using AJAX, but I
Or you could do it on the server and not update the page using AJAX.
See the W3C validator for an example.
Quote:
specifically need the client to request the page, not the server.
Why?

[snip]
Bart Van der Donck
Guest
 
Posts: n/a
#3: Nov 20 '08

re: 3rd party page access from JavaScript. Is this possible?


Mike Harrison wrote:
Quote:
Hi, is it possible to do something like this using JavaScript?
>
My page should prompt the user for a 3rd party URL. It will then
validate this URL, request the page, analyse it and update the main
page with the results of the analysis.
>
I can load the 3rd party page into an iframe no problem, but I'm
unable to access the document source because it's come from a
different domain. This domain is out of my control.
>
Is there any way to do this using client side technology? I realise I
could do this on the server and update the page using AJAX, but I
specifically need the client to request the page, not the server.
>
Is there another angle I could approach this from? I just need read-
only access to the page source, which will be standard HTML. The page
itself doesn't need to be displayed to the user.
You might be interested in Ajax Cross Domain:

http://www.ajax-cross-domain.com/

It would be dangerous to allow any URI from the user, because the
responsability for the arbitrary requests will be laid at the server
(e.g. Spam).

Hope this helps,

--
Bart
Closed Thread