Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>For basic Javascript/jQuery debugging, try this:</p> <pre><code>&lt;script type="text/javascript"&gt; alert("Javascript works!"); $(document).ready(function(){ alert("jQuery works!"); }); &lt;/script&gt; </code></pre> <p>If you only get the first alert window, it means that something is wrong with the way that jQuery is referenced. If you don't get either window in Firefox (but you do in other browsers), you'll want to make sure that Javascript is turned on in Options > Content, and you'll want to make sure that no plugins would be blocking Javascript.</p> <p>(Edited, because more code snippets have been added to the original post:)</p> <p>In the second code snippet that you posted, "loc.lenght" should be "loc.length".</p> <pre><code>$('input:radio').click(function() { var num = ""; var location = ""; var loc = $("input:checked").val(); var lenght = loc.lenght; var tmp = loc.substring(0, 2); alert(loc.substring(2, lenght)); </code></pre> <p>It seems like the line <code>var lenght = loc.lenght;</code> is causing problems because <code>loc.lenght</code> probably isn't returning the value that you want (because <code>lenght</code> isn't a property). I've added an <code>alert</code> to your code, which should pop up the string that you calculate in the <code>if</code> statements following this section. You should run this code, with the <code>alert</code> in all three browsers to see what the difference is.</p> <p>I'm not sure why this would be working in some browsers but not Firefox. Maybe <code>loc.lenght</code> is returning 0 in IE 8 and Chrome, but <code>null</code> in Firefox, which would break the whole calculation.</p>
 

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