By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,508 Members | 1,856 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,508 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.
Nov 20 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Nov 20, 7:33*am, Mike Harrison <mjh...@yahoo.co.ukwrote:
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]
Nov 20 '08 #2

P: n/a
Mike Harrison wrote:
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
Nov 20 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.