Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
I';我刷新了ul标记以便可以应用jQuery样式,但我的页面只显示正在加载的jQuery图像_Jquery_Css_Wordpress_Jquery Mobile_Woocommerce - Fatal编程技术网

I';我刷新了ul标记以便可以应用jQuery样式,但我的页面只显示正在加载的jQuery图像

I';我刷新了ul标记以便可以应用jQuery样式,但我的页面只显示正在加载的jQuery图像,jquery,css,wordpress,jquery-mobile,woocommerce,Jquery,Css,Wordpress,Jquery Mobile,Woocommerce,我正在为wordpress开发一个woocommerce主题,并尝试向元素添加一些属性,以便将jQuery mobile样式应用于该元素 为此,我将一个脚本加入名为“woocommerce\u before\u shop\u loop”的钩子中 scrypt如下所示: (function ($){ $(document).on('pageinit','#shop', function(){ $('ul').attr('data-role', 'listview'); $('ul'

我正在为wordpress开发一个woocommerce主题,并尝试向
元素添加一些属性,以便将jQuery mobile样式应用于该元素

为此,我将一个脚本加入名为“woocommerce\u before\u shop\u loop”的钩子中

scrypt如下所示:

(function ($){
$(document).on('pageinit','#shop', function(){
    $('ul').attr('data-role', 'listview');
    $('ul').attr('data-inset','true');
    });
})(jQuery);
通过这个脚本,我成功地将属性添加到我想要的
标记中。但这样就不会应用jquery移动样式。 然后,我刷新了列表,以便jquery可以以友好的方式添加其类atributes。新脚本是:

(function ($){
$(document).on('pageinit','#shop', function(){
    $('ul').attr('data-role', 'listview');
    $('ul').attr('data-inset','true');
    $('ul').listview(); // to refresh the <ul> tag
});
})(jQuery);
(函数($){
$(文档).on('pageinit','#shop',function(){
$('ul').attr('data-role','listview');
$('ul').attr('data-inset','true');
$('ul').listview();//刷新
    标记 }); })(jQuery);
像这样,我已经完成的是jquery可以以友好的方式添加它的类,并且我已经能够使用chrome控制台来检查它。但是现在添加了jQuery类,我的页面没有显示任何内容,它只显示jQuery加载图像,但内容从未显示

在这里你可以看到我的网站:和加载图像。您还可以通过chrome控制台检查
中我在脚本中设置的属性和jQuery中的类是否已添加到
标记中

我希望有人能帮我解决这个问题


提前感谢

工作很好,没有加载旋转器。那我为什么看到它??你看到它是用jquerystyle设计的吗
    标记Omar?Ii是一个缓存问题…但现在我有另一个问题了!如果我使用danielvivancos.com/edu/wordpress/shop进入页面,则会应用样式,但如果我从danielvivancos.com/edu/wordpress主页进入页面,则不会应用样式。有什么想法吗,奥马尔??感谢您检查我的站点并告诉我它实际上正在运行删除这些
    (函数($){
    })(jQuery)。然后尝试
    pagebeforeshow
    pageshow
    而不是
    pageinit
    。不工作。通过这些更改,我的脚本什么也不做:(