I have a PHPlot PNG graph that loads fine in a browser. When it is loaded, the
script reads a data file and plots what it finds. The data file is updated
every minute. I have tried to write a Javascript routine that auto-updates
just the graph, not the whole page, using jQuery. The PHPlot output is
embedded in an HTML IMG tag:
<img src="../scw.php" width="720" height="360" alt="sky temperature graph" />
The javascript I'm using is supposed to look for an id in the tag and reload
the object identified by the id.
If I set the IMG tag in
tags and add the id to the
tag:
the file is reloaded, but it is treated as text and the PNG is
rendered as a long character string. If I associate the id with the IMG tag: then the image does not reload. (I have tried adding a
?+random suffix, no difference)
I don't know if this is something to do with Javascript, or whether it has to
do with the PNG file generated by PHPlot, but I mention it here in case it is
PHPlot related.
Advice appreciated.
DN
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Looks like it was a Javascript problem. I tried yet another update method and
it worked, but it was a matter of creating more of the HTML in Javascript, not
just a simple image replace based on ID.
DN
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a PHPlot PNG graph that loads fine in a browser. When it is loaded, the
script reads a data file and plots what it finds. The data file is updated
every minute. I have tried to write a Javascript routine that auto-updates
just the graph, not the whole page, using jQuery. The PHPlot output is
embedded in an HTML IMG tag:
The javascript I'm using is supposed to look for an id in the tag and reload
the object identified by the id.
If I set the IMG tag in
tags and add the id to the
tag:
the file is reloaded, but it is treated as text and the PNG is
then the image does not reload. (I have tried adding a
rendered as a long character string. If I associate the id with the IMG tag:
?+random suffix, no difference)
I don't know if this is something to do with Javascript, or whether it has to
do with the PNG file generated by PHPlot, but I mention it here in case it is
PHPlot related.
Advice appreciated.
DN
Looks like it was a Javascript problem. I tried yet another update method and
it worked, but it was a matter of creating more of the HTML in Javascript, not
just a simple image replace based on ID.
DN