Note that there are some explanatory texts on larger screens.

plurals
  1. POJQuery On method doesn't work
    text
    copied!<p>I got this error in Firefox: TypeError: $("#main-CNTR").on is not a function. And this code doesn't work at all:</p> <pre><code>$(document).ready(function(){ $('#main-CNTR').on('mouseenter','.social_span',function(){ alert("INSIDE"); }); $('#main-CNTR').on('mouseleave','.social_span',function(){ alert("OUTSIDE"); }); }); </code></pre> <p>The HTML part is this </p> <pre><code> &lt;span class="social_span"&gt;&lt;/span&gt; &lt;div class="row clearfix" style="display:none;"&gt; &lt;ul class="social-buttons cf"&gt; &lt;li&gt;1&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>On mouse entering the span a message should be displayed and the next div shown. Obviously the div#main-CNTR is the main content container div and the HTML snippet is repeated several time in the page.</p> <p>The live method correctly works but not in ie8.</p> <pre><code>$('.social_span').live('mouseenter',function(){ alert("INSIDE"); }); $('.social_span + .row').live('mouseleave',function(){ alert("OUTSIDE"); }); </code></pre> <p>Can anyone help me? Thanks!</p> <pre><code> &lt;script type="text/javascript" src="/js/libs/modernizr-2.5.3.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/js/jQuery/engine/core8.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/js/jQuery/engine/ui.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/js/jQuery/plugin/jquery.tools.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/js/jQuery/plugin/jquery.easing.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/js/jQuery/plugin/jquery.lavalamp.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/js/jQuery/plugin/jquery.fancybox.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/js/jQuery/plugin/jquery.li-scroller.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/js/jQuery/plugin/jquery.reflection.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/js/jQuery/plugin/jquery.jcarousel.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="/js/jQuery/plugin/jquery.selectbox.js"&gt;&lt;/script&gt; </code></pre>
 

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