开发者

javascript strange behaviour of jQuery .click

I ahve a html file, in which I inclu开发者_运维技巧de .js file. This file contains this code:

$(document).ready(function(){
    $("button.save").click(function(){
        alert("payment_type_form_");
    });
    PlanTabs.Open("payments");
    $("#payment-types-accordion").lyfAccordion();
});

All good works. But .click() doesn't. If I move this code to html <script></script> all good nice.

I want to keep javascript code in file, not in html. How can I do it?

Thank you in advance. Sorry for my english)


Are you sure jQuery is included before this script file? That's where I've encountered these problems.


try putting your script near the bottom of the </body> tag

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜