Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

writing a function for document.ready

$
0
0

How to write a function that will communicate and ready the service being used with a simple message. The service is taking a while to load because it goes dormant when not being used so it has to "wake up" every time. So basically I need a function that communicates with server after document.ready to wake up, so then when the user searches for something in the service it doesn't take forever to load because it will already be loaded.  Is this on the right track? 

    function sayHello() {
        if (receiveReq.readyState == 4 || receiveReq.readyState == 0) {
            receiveReq.open("GET", 'service', true);
            receiveReq.onreadystatechange = handleSayHello;
            receiveReq.send(null);
        }
    }


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>