akoifman
asked on
Updating page content using server data
Hi,
I have a page in a frame that displays the status of a device. I refresh the page every 3 seconds and use CGI script to get the status. Most of the time the status does not change.
I would like to read the status variable from the server and update the page status only upon change. I do not like the idea of a page refresh.
Can I use JavaScript for this? How can I read info from server?
I know that I can use a Java applet to read the page and compare the last status with prior one. If it changed then I'll ask the applet to reload the page (a frame).
What is the best way to accomplish what I need? Which is: read data from server and display status change if needed.
Thanks,
Alex.
I have a page in a frame that displays the status of a device. I refresh the page every 3 seconds and use CGI script to get the status. Most of the time the status does not change.
I would like to read the status variable from the server and update the page status only upon change. I do not like the idea of a page refresh.
Can I use JavaScript for this? How can I read info from server?
I know that I can use a Java applet to read the page and compare the last status with prior one. If it changed then I'll ask the applet to reload the page (a frame).
What is the best way to accomplish what I need? Which is: read data from server and display status change if needed.
Thanks,
Alex.
You can do that using XMLHTTP, but you will have to trigger some check from browser side anyway, you cannot send request from the server to the client invoked by the server.
ASKER
Hi,
What is XMLHTTP? IS this just XML over HTTP? How do I trigger the client request? Can I do this with JavaScipt?
Thanks.
What is XMLHTTP? IS this just XML over HTTP? How do I trigger the client request? Can I do this with JavaScipt?
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Or...
Just put a hidden frame or iframe in the page and do the request to the server from there. When the information changes, a little JAvaScript snippet in the hidden frame then updates the main page.
Does not require any server side support that is not already there.
Cd&
Just put a hidden frame or iframe in the page and do the request to the server from there. When the information changes, a little JAvaScript snippet in the hidden frame then updates the main page.
Does not require any server side support that is not already there.
Cd&
ASKER
Hi,
You write:
>>Just put a hidden frame or iframe in the page and do the >>request to the server from there.
Do you mean by applet loading the page in the browser periodically, say every 3 seconds? Will this keep the annoying reload bar at the bottom of the browser flashing?
Thanks.
You write:
>>Just put a hidden frame or iframe in the page and do the >>request to the server from there.
Do you mean by applet loading the page in the browser periodically, say every 3 seconds? Will this keep the annoying reload bar at the bottom of the browser flashing?
Thanks.
Yes the reload bar will flash if it is visible.
If that is annoying, then open the page in a new window with no status bar.
Cd&
If that is annoying, then open the page in a new window with no status bar.
Cd&
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
<note>
In the absence of responses, I may recommend DELETE unless it is clear
to me that it has value as a PAQ. Silence = you don't care
</note>
Cd&
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
<note>
In the absence of responses, I may recommend DELETE unless it is clear
to me that it has value as a PAQ. Silence = you don't care
</note>
Cd&
It is time to clean this abandoned question up.
I am putting it on a clean up list for CS.
<recommendation>
split avner, CJ_S, and COBOLdinosaur
</recommendation>
If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.
Cd&
I am putting it on a clean up list for CS.
<recommendation>
split avner, CJ_S, and COBOLdinosaur
</recommendation>
If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.
Cd&
Per recommendation, force-accepted.
Netminder
CS Moderator
avner: points for you at https://www.experts-exchange.com/questions/20350826/For-avner-re-20321089.html
COBOLdinosaur: points for you at https://www.experts-exchange.com/questions/20350827/For-COBOLdinosaur-re-20321089.html
Netminder
CS Moderator
avner: points for you at https://www.experts-exchange.com/questions/20350826/For-avner-re-20321089.html
COBOLdinosaur: points for you at https://www.experts-exchange.com/questions/20350827/For-COBOLdinosaur-re-20321089.html