Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.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
wordpress中的jQuery在ie8中效果不佳_Jquery_Wordpress_Internet Explorer 8 - Fatal编程技术网

wordpress中的jQuery在ie8中效果不佳

wordpress中的jQuery在ie8中效果不佳,jquery,wordpress,internet-explorer-8,Jquery,Wordpress,Internet Explorer 8,我想用jQuery在WordPress中开发简单的幻灯片。它在除IE之外的所有浏览器中都能正常工作 var blockShow = function(element,nav,duration) { //alert(element); container = jQuery(element); // but in this function throw error: Object doesn't support this property or method } // this works

我想用jQuery在WordPress中开发简单的幻灯片。它在除IE之外的所有浏览器中都能正常工作

var blockShow = function(element,nav,duration) {
  //alert(element);
  container = jQuery(element); // but in this function throw error: Object doesn't support this property or method
}

// this works
jQuery(document).ready(
  function() {
    if(jQuery('#header-slideshow')) {
      blockShow('#header-slideshow');
    }
  }
);

更新:我忘了说:在WP之外,它工作得很好。在IE和其他任何地方,它必须是WP中的某个东西。

根据我的经验,如果某个东西在IE中不起作用,但在其他地方,它是两件事之一

1-您的某些语法有点错误-可能会使用无效的html(尝试验证html和css)或其他逗号。其他浏览器往往更擅长忽略小的语法错误

2-您与wordpress的现有脚本存在某种冲突。尝试重新组织加载顺序

在看不到实际站点的情况下,我唯一能推荐的另一件事就是备份你的模板,系统地一个一个地删除wordpress元素,直到它工作为止!它有助于识别问题代码