Here is the code:
$(document).ready(function(){ var pause = 5000; function removeFirstNewsTicket() { addLastNewsTicket(); } function addLastNewsTicket() { alert('123123'); } setInterval(removeFirstNewsTicket, pause); });
The question is, why does the alert work 2 times every 5 seconds? Generally shook me js. Explain somebody, please. Once and for all I want to deal with it = As a reward, I will give you as many points as you ask.
UPD1 makregister. Nothing helps. I tried to endure - all to no avail
UPD2 Alexander, did just that. Removed $ (document) .ready () - now everything is as it should.
UPD3 The css framework http://www.99lime.com/ was connected. After shutdown everything worked as it should. He also uses jQuery. Question: how to make the script work as it should through $ (document) .ready () and not be called 2 times with the above css-framework connected? For the decision - reward 500 mana points)
UPD4 I have one script is not connected twice. Apparently you have to deal with 99lime, since this is the case. Is it necessary to use ready () in general? What is the risk of refusing to use it?