开发者

change submit in to onkeyup event

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜