Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用以下内容监听点击事件:
$('div').bind("click"),function() { // do something });
它的工作,除了我需要事件也触发页面加载。我怎样才能让它做到这一点?
触发点击:
$('div').bind("click"),function() { // do something }).click();
$(document).ready(function() { $('div').on("click", doSomething); doSomething(); }); function doSomething() { //do the load and click thing }