【发布时间】:2014-12-02 13:02:42
【问题描述】:
我在一个名为 clockIn.html 的文件中有这个 div
<div data-role="page" data-theme="a" id="hrsWorked">
<div data-role="header" data-theme="a">
<h1>Hours Worked</h1>
<a href="clockIn.html" id="exitBtn">Back</a>
</div>
<div data-role="content">
<div id="hrsWorkedDiv">
</div>
</div>
</div>
我在clockIn.js中有这个eventListener,它包含在clockIn.html的顶部
$(document).on("#hrsWorked", "pageshow", function()
{
alert('here 1');
displayHrsWorked(localStorage.getItem('carerID'));
});
我没有收到警报。我究竟做错了什么?我对此很陌生,正在拿起别人的代码。 Jquery 移动版:'js/jquery.mobile-1.2.0.min.js' 和cordova 版本:'js/cordova-2.6.0.js'
【问题讨论】:
-
"pageshow", ".selector", function事件和选择器。 -
@Omar 哦,我明白了,谢谢
标签: javascript jquery html jquery-mobile cordova