?
Solved

Updating page content using server data

Posted on 2002-07-08
9
Medium Priority
?
216 Views
Last Modified: 2010-05-18
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.
0
Comment
Question by:akoifman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 14

Expert Comment

by:avner
ID: 7139725
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.
0
 

Author Comment

by:akoifman
ID: 7140390
Hi,

What is XMLHTTP?  IS this just XML over HTTP?  How do I trigger the client request?  Can I do this with JavaScipt?

Thanks.
0
 
LVL 22

Accepted Solution

by:
CJ_S earned 268 total points
ID: 7140399
It retrieves HTTP through XML.

Here's a little sample:
<script language="VBScript">
<!--
Public Function GetHTML(url, sError)
on error resume next
     Set objXML = CreateObject("Microsoft.XMLHTTP")
     objXML.open "GET", url, false
     Call objXML.send
     If(objXML.status<>200) Then
          GetHTML = sError
     Else
          GetHTML = objXML.responseText
     End If

     Set objXML = Nothing
End Function

sData = GetHTML("http://www.experts-exchange.com", "Unable to retrieve site")

MsgBox(sData)
//-->
</script>
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7140819
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&
0
 

Author Comment

by:akoifman
ID: 7140890
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.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7141673
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&
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7212815
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&
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7240534
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&
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7263483
Per recommendation, force-accepted.

Netminder
CS Moderator

avner: points for you at http://experts-exchange.com/Web/Web_Languages/HTML/Q_20350826.html
COBOLdinosaur: points for you at http://experts-exchange.com/Web/Web_Languages/HTML/Q_20350827.html
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question