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.
我试图找到一种方法来阻止 JQM 页面上两个 js 文件之间的冲突。我想知道有没有办法让 js 文件只加载一个 data-role=page?
ID例如,通过其' 调用页面。
ID
$('[data-role=page]#PageID').on('pagebeforeshow', function () { alert('Page with ID ' + $(this)[0].id + ' is here!' });