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

M

Mike Harrison

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.
 
D

David Mark

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.
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.
specifically need the client to request the page, not the server.

Why?

[snip]
 
B

Bart Van der Donck

Mike said:
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,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top