Help - Search - Members - Calendar
Full Version: javascript question
Invision Power Services > Community Forums > Community Web Design and Coding
Trel
is there any simple way to use javascript to access a url, get the HTML output, and assign it to a variable?
Michael K.
XMLHttpRequest. thumbsup.gif
_
You can't access an URL with AJAX, you can access a page though.
Michael K.
QUOTE(Veracon @ May 14 2005, 01:54 PM) *
You can't access an URL with AJAX, you can access a page though.

Ah, you're right, didn't think of that. In that case, no, don't think there's a way.
Although.. perhaps if you use XMLHttpRequest to call a PHP file, which could get the contents (in most cases) of external sites. Would that help?
_
QUOTE(Gornakle @ May 14 2005, 02:04 PM) *
Ah, you're right, didn't think of that. In that case, no, don't think there's a way.
Although.. perhaps if you use XMLHttpRequest to call a PHP file, which could get the contents (in most cases) of external sites. Would that help?

thumbsup.gif
Rikki
The security model of xmlhttprequest won't allow you to access XML files on any domain other than the one the current page is on. That might be fine for you, but from the sounds of it you want to access a different site, so xmlhttprequest won't be suitable.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.