No, I mean I now use window.onload as a workaround (instead of $(function(){})), it fires only once of course, but I did not like it because I can only use it once in the code. I did not know about $(window).load(func), thats very nice, thanks.
>>>>> Regarding 'Re: running an onload code snippet only once'; MorningZ adds: > Those events window.onload, in jQuery, that would be $(window).load > (...), should *not* be firing at any time other than when the > document loads the first time... something else has to be going on > with your code to fire off that code again > On Dec 15, 3:27 pm, Richard KLINDA <rkli...@gmail.com> wrote: >> Hello, what is a good way to run a code snippet after the page is >> loaded, but only just one time? >> I use the ready event $(function(){...}); most of the time, but >> sometimes it fires multiple times (when the DOM changes I think), >> and rarely there are stuff that I only want to run JUST ONCE per >> pageload. >> What is a good way to achieve that? >> Now I do window.onload = function() {...}, but I hope there is >> something better. >> Thanks in advance... >> -- Richard -- Udv, Richard