开发者

change submit in to onkeyup event

开发者 https://www.devze.com 2023-02-21 14:31 出处:网络
I have found a nice script at Google Powered Site SearchI\'m trying to change the jquery with no luck so far.

I have found a nice script at Google Powered Site Search I'm trying to change the jquery with no luck so far.

I changed this code:

$(‘#searchForm’).submit(function(){
googleSearch();
return false;
});

In to this:

$(‘#s’).keyup(function() {
$(‘#searchForm’).submit(function(){
googleSearch();
ret开发者_Go百科urn false;
});

But it doesn’t work…Can someone tell me way that is.??

I also tried this:

$(“input”).keyup(function () {
googleSearch();
return false;
});

Also didn’t work. It’s just jquery so it should work..

Thank's


Do the original code is working? Also the modified code have missing end braces.

Check this:

    $('#s').keyup(function() {
        $('#searchForm').submit(function(){
        googleSearch();
        return false;
        });
    });


Try this, it works :

$("#s").keyup(function(){
     googleSearch();
     return false;         
 })

See Eg

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号