PDA

View Full Version : Displaying text from a remote url


jhodgski
07-04-2007, 09:21 AM
I want to display text in my html page from a remote url (possibly, continually updating).

I've seen a solution for how to do this with php, but my host server doesn't have php support. Is it possible with javascript? (Any code much appreciated.)

Thanks,
James

Pete33
07-05-2007, 05:13 AM
You could try using a virtual command.

The following script placed in your page will copy the contents of the external page and make it look like it's part of yours.

<!--#include virtual="http://theUrlYouWantToShow.html" -->

You'll have to test it to see if your web provider allows you to use it. You might also have to amend your .htaccess to get it to run on an html page, otherwise you will have to rename your page to .shtml

jhodgski
07-09-2007, 05:41 AM
Cheers Pete,

Would a more reliable alternative be to use an iframe?

Pete33
07-09-2007, 05:53 AM
Frames are never to be recommended, but sometimes you just have to use them. If it's just on one or two pages then it's probably okay, so you can certainly go ahead and try it.