0
我正在使用Wordpress和JQuery Mobile版本1.4.5。我的问题是下面的代码不工作只有$(document).ready
工作正常。我在wordpress中是新手,我不知道什么是错的。JQuery Mobile页面事件未触发
$(document).on('pagecreate','[data-role=page]', function(){
console.log('PAGECREATE');
});
$(document).on('pageinit','[data-role=page]', function(){
console.log('PAGEINIT');
});
$(document).on('pagebeforeshow','[data-role=page]', function(){
console.log('PAGEBEFORESHOW');
});
$(document).on('pageshow','[data-role=page]', function(){
console.log('PAGESHOW');
});
$(document).on('mobileinit','[data-role=page]', function(){
console.log('mobileinit');
});
$(document).ready(function(){
console.log("ready");
});
我这是怎么插入JQM在funtion.php
wp_deregister_script('jquerypremobile');
wp_register_script('jquerypremobile', get_template_directory_uri() .'/jmobile/jquery.mobile-1.4.5.js', array('jquery'), '1.0');
wp_enqueue_script('jquerypremobile');
这是正确的?