Click to See Complete Forum and Search --> : Updating the text of a web page dynamically
gawande
09-18-2003, 08:36 PM
Hi,
I am a newbie to JavaScripting. So please pardon my ignorance.
I want to read data (text) from a website (hosted by somebody else) that contains LIVE information (gets updated/refreshed every 30 secs or so) and then I want to include that data (text) into HTML code of my webpage.
In short, how can I read data from an already existing web page (I have no control on it's source code) and then update my web page with the same data using JavaScript ?
Also I want to make sure that even my web page is refreshed every N secs (I have already implemented that).
Thanks, in anticipation,
-K-
You can't do this with JavaScript. You will have to use some serverside language. I personally use and recommend PHP.
gawande
09-19-2003, 03:04 PM
Hi Pyro,
Thanks for your quick response. Do you have a quick link or some sample code that I can maybe get a look at ?
I have used PHP to some extent - transferring form contents dynamically using Session variables and stuff ... but never done anything like the task on hand.
I would appreciate your help,
-K-
ps - Maybe I can get some help from a PHP dev. forum ;-)
Post your question in the PHP section, and I or someone else will answer it. Include how the data is set apart from the rest of the page, so we know how it can be parsed out and used on your page.
thkaal
11-12-2005, 04:44 PM
I am attempting to do the same thing in a frame. Well, almost the same thing. I'm trying to have a page open in a frame of my website. the i want it to automatically update once a month. This is the code thus far, and I would appreciate the few lines remaining.
<HTML>
<HEAD>
<link rel="stylesheet" href="Ewequilt.css">
</HEAD>
<BODY background>
<p align="center"><img src="images/title.gif">
<br>
<font><b>Open Monday thru Saturday, 10:00 A.M. - 5:00 P.M.</b></font>
<br>
<font><b><script language="javascript" src="http://www.ewequiltnsuch.com/session.asp"></script></b></font>
<table align="center" border=0 width=85%>
<tr> <td width=10%><table border=1>
<tr>
<td><font><a href="index.html">Homepage</a></font>
<tr>
<td><font><a href="location.html">Our Location</a></font>
<tr>
<td><font><a href="contact.html">Contact Us</a></font>
<tr>
<td><font><a href="gallery.html">Gallery</a></font>
<tr>
<td><font><a href="classes.html">Classes</a></font>
<tr>
<td><font><a href="shop.html">Shop Online</a></font>
<tr>
<td><font><a href="archive.html">Archives</a></font>
</table>
<td width=70% valign="top">
<script language="javascript">
var d=new Date()
var j=d.getFullYear()
var b=d.getMonth()+1
var month=new Array()
month[1]="Jan"
month[2]="Feb"
month[3]="Mar"
month[4]="Apr"
month[5]="May"
month[6]="Jun"
month[7]="Jul"
month[8]="Aug"
month[9]="Sep"
month[10]="Oct"
month[11]="Nov"
month[12]="Dec"
</script>
<iframe width=100% height=100% src=month[b]+j+".txt"></iframe>
<td valign="top"><font>hi there</font>
</body>
</html>
the part in red is where i begin to have troubles.
first you must find out if the web page is readable then use a textstream objectto read it
then you could use a innerText or outerText line to update but i think its illegal
thkaal
11-13-2005, 05:43 PM
I hope it's not illegal, i'm writing from my site to my site. Or are you referring to 'illegal function' errors?
if your writing from one site to another why not just put the text in a file and acces it from both sites