118 js Uncaught ReferenceError: Invalid left-hand side in assignment

You can't assign a new value to the result of a function

$('input#q').val() = urlencode($('input#q').val());

Use this instead:

$('input#q').val(urlencode($('input#q').val()))

It wouldn't work with the keypress either - maybe the page is simply submitted after the same js error occurs.

你可能感兴趣的:(js)