Infinite loop wait 2 second, make server call jquery
<p>I am making a simple game with jquery and i want to make a call to asp.net web service which i  know how to do, but the server call need to continue to run until i get a specific response from the server.</p>

<p>I will wait like 3 seconds with each loop cycle</p>

<pre><code>function servercall() {
            while (true) {
                // code for clone and insert  ...
                $.ajax({
                    type: "POST",
                    url: "Server.asmx/HelloWorld",
                    data: "{'name': '" + $('#name').val() + "', 'time': '2pm'}",
                    contentType: "application/json; charset=utf-8",
                    dataType: "json",
                    success: function(msg) {
                        AjaxSucceeded(msg);
                    },
                    error: AjaxFailed
                });
                setTimeout("nothing", 2000);
            }

        }
</code></pre>
