Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery $(document).ready () fires twice
    primarykey
    data
    text
    <p>So i've been sifting around the web trying to find out whats going on here and I have not been able to get a concrete answer.</p> <p>I have one $(document).ready on my site that seams to run multiple times regardless of the code that is inside it.</p> <p>I've read up on the bug reports for jQuery about how the .ready event will fire twice if you have an exception that occurs within your statement. However even when I have the following code it still runs twice:</p> <pre><code>$(document).ready(function() { try{ console.log('ready'); } catch(e){ console.log(e); } }); </code></pre> <p>In the console all I see is "ready" logged twice. Is it possible that another .ready with an exception in it would cause an issue? My understanding was that all .ready tags were independent of each other, but I cannot seem to find where this is coming into play?</p> <p>Here is the head block for the site:</p> <pre><code>&lt;head&gt; &lt;title&gt;${path.title}&lt;/title&gt; &lt;meta name="Description" content="${path.description}" /&gt; &lt;link href="${cssHost}${path.pathCss}" rel="stylesheet" type="text/css" /&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript" charset="utf-8"&gt;&lt;!----&gt;&lt;/script&gt; &lt;script src="media/js/fancybox/jquery.fancybox.pack.js" type="text/javascript" &gt;&lt;!-- --&gt;&lt;/script&gt; &lt;script src="/media/es/jobsite/js/landing.js" type="text/javascript" &gt;&lt;!-- --&gt;&lt;/script&gt; &lt;script src="/media/es/jobsite/js/functions.js" type="text/javascript"&gt;&lt;!-- --&gt; &lt;/script&gt; &lt;script src="/media/es/jobsite/js/jobParsing.js" type="text/javascript" charset="utf-8"&gt;&lt;!----&gt;&lt;/script&gt; &lt;script src="/media/es/jobsite/js/queryNormilization.js" type="text/javascript" charset="utf-8"&gt;&lt;!----&gt;&lt;/script&gt; &lt;script src="${jsHost}/js/jquery/jquery.metadata.js" type="text/javascript" charset="utf-8"&gt;&lt;!----&gt;&lt;/script&gt; &lt;script src="${jsHost}/js/jquery/jquery.form.js" type="text/javascript" charset="utf-8"&gt;&lt;!----&gt;&lt;/script&gt; &lt;script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.7/jquery.validate.min.js" type="text/javascript" charset="utf-8"&gt;&lt;!----&gt;&lt;/script&gt; &lt;script src="${jsHost}/js/jquery.i18n.properties-min.js" type="text/javascript" charset="utf-8"&gt;&lt;!----&gt;&lt;/script&gt; &lt;script type="text/javascript" charset="utf-8"&gt; function updateBannerLink() { var s4 = location.hash.substring(1); $("#banner").attr('href','http://INTELATRACKING.ORG/?a=12240&amp;amp;c=29258&amp;amp;s4='+s4+'&amp;amp;s5=^'); } &lt;/script&gt; &lt;/head&gt; </code></pre> <p>Pay no attention to the JSP variables, but as you can see i'm only calling the functions.js file once (which is where the .ready function exists)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload