Cheap Cameras - Wordpress Themes - Hindi movies, hindi songs - Wordpress Theme - Debt Consolidation

PDA

View Full Version : How to access remote URL


freeven
Apr 20th 2007, 5:01 pm
This is my first post. I have some basic programming knowledge, but I'm new to javascript. I'm trying to create a script that will

1) retrieve specific information from a remote page (without displaying the page);

2) reformat that information;

3) display the reformatted information on my page.

I've been reading some online guides and tutorials, and I think I can figure out how to do steps 2 and 3. However, I'm lost as to how to do step 1. The closest thing I've found in the reference guides is the "location" attribute (not sure if attribute is the proper term), but that doesn't look like what I need, since I don't want to actually display the page. I just need to be able to read it in and extract some information.

Can anyone point a newbie in the right direction?

Thanks.

webcosmo
Apr 20th 2007, 6:29 pm
From my experience I dont thing Javascript has such capability of reading a file from a remote server. Its a client side script which runs on user browser and do perform things there not outside. But as alternate you can use other scripting languages like cgi/php/asp etc to fetch the url and read the content in a variable.

Aragorn
Apr 21st 2007, 4:52 am
Yes, it is possible. Use Ajax to query the remote page. Process the response from the server. And display it in your page.

MattD
Apr 22nd 2007, 3:46 am
Just use XMLHttpRequest to get it

costin_trifan
Apr 23rd 2007, 3:00 pm
I use ASP.NET and Visual Basic.NET to retrieve and display all the content that the remote page has in the <head> and </head>.
If that helps you, then check out my blog ["http://jasp-costin.blogspot.com/2007/04/crawling-competitors-web-site.html"].

HTH.

freeven
Apr 23rd 2007, 10:59 pm
Thanks for the replies. Seems there are a number of solutions. I ended up using PHP instead of javascript as it had the built in functions to do just what I needed.

Thanks.