Click here to Skip to main content
15,894,646 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,

I want to ajax poll the call to method to get data.
This is the ajax call back, I need to auto poll the call for every 3 secs

$.ajax({
    type: "POST",
    url: "Default.aspx/getPak",
    data: "{}",
    contentType: "application/json; charset=utf-8",
    dataType: "json",
    success: function (msg) {
        strPak = msg.d;
    }
                });

Code works fine for first time. But I want to call at certain intervals like 3 secs or something.
Your help will be appreciated.
Thanks in advance.

Note: I tried
setInterval("location.reload();", 3000);
But I want optimized ajax call ;-)
Posted
Updated 19-Apr-18 11:00am

1 solution

 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900