javascript - jquery ajax send data double to php -


I counted a normal JavaScript and at the end of the countdown, an AJAX request should save the database to the database.

It works fine but it saves entrance twice, why does it save double but any suggestions? (Sorry for my English I'm German)

  var countdown =  <= 0) {// Funktion document.getElementById ("counter"). InnerHTML = "N & amp; aum; chste Kampagne wird geladen"; Var datastring = {ip: & lt ;? Php echo json_encode ($ ip)? & Gt;, uid: & lt ;? Php echo json_encode ($ uid)? & Gt;, tone: & lt ;? Php echo json_encode ($ tan)? & Gt ;; Reload: & lt ;? Php Echo Jason_Ancode ($ reloaded)? & Gt;, Verdinest: & lt ;? Php Echo Jason_ AND ($ Vertient)? & Gt;, Priis: & lt ;? Php Echo Jason_Adid ($ Priest)? & Gt; }; $ .ajax ({type: 'post', url: 'http://xxxxxxxxxxx.de/xxxxxxxxxx/xxxxxxxxxx.php', data: dataseting, // success: function (data) {// $ ('# results' ). Html (data); //}}); } And {document.getElementById ("counter"). InnerHTML = Countdown; }} If (Countdown = 0) {setTimeout ("count ()", 1000); }} Calculation ();  

Kind regards

change this:

  if (countdown> = 0) {setTimeout ("count ()", 1000); }  

with this:

  if (countdown> gt; {setTimeout ("count ()", 1000); }  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -