jQuery “g is undefined”

OK totally quick post this. Was getting this error inexplicably in the console, couldn’t work out what was causing it, commented out all but the most simple lines of code….. Still there! If in doubt – check the version of jQuery you’re using and try upgrading it. Worked for me. Incidentally this had nothing to do with AJAX/JSON – as I was still getting the error even without making any calls to any AJAX methods, BUT all the search results I’d found seemed to suggest a probelm in this area.

Leave a Reply

  1. thor

    same problem here, did you get it working?

    if i removed the matches and match in: data.matches and function(i, match) it kinda works, it just retuned a long list of “undefined”

    $.each(data.matches, function(i, match){
    content += ” + match.title + ”;
    $(content).appendTo(“#search-results”);

  2. dave

    got it :) it’s about jquery functions like hover or bind. These functions uses two parameters. In my script I have used only one and that’s why I get the “g is undefiuned” error. Here is a ticket, but marked as closed http://bugs.jquery.com/ticket/3198 becouse there was a bug in a user script, not a jquery.

Posted