aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Pinging server through javascript(Using XMLrequest) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Pinging server through javascript(Using XMLrequest)" Watch "Pinging server through javascript(Using XMLrequest)" New topic
Author

Pinging server through javascript(Using XMLrequest)

sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hi

i need to ping server from my client at repeated intervals . Currently i am using XMRequestObject().....to ping the server using .send method


Here is the script function used (javascript)

function pingServer()
{
if (window.ActiveXObject)
{
req = new ActiveXObject("Microsoft.XMLHTTP");
if(req)
{
req.open("GET", '<%=request.getContextPath()%>/ping.do', true);
req.send();
}
}
setTimeout("pingServer()", 10000);
}


But the problem is that its entering the function everytime , but the call to the server is not happening everytime

can any one let me know whats the reason for this ??
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Try playing with this: not sure if it will do what you want.



Eric
sreenath reddy
Ranch Hand

Joined: Sep 21, 2003
Posts: 415
Hi eric

Thanks a lot .it worked with same code as i had posted ..there was some problem with the server side code written

SOrry for the trouble

Regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pinging server through javascript(Using XMLrequest)