Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.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
Internet explorer IE剥离锚定标签的问题_Internet Explorer_Url_Rewrite_Anchor - Fatal编程技术网

Internet explorer IE剥离锚定标签的问题

Internet explorer IE剥离锚定标签的问题,internet-explorer,url,rewrite,anchor,Internet Explorer,Url,Rewrite,Anchor,我正在构建一个包含子菜单项的菜单的网站。我的两个子菜单项链接到我的一个页面中的锚定标记。在FF和Chrome中,它们按预期工作,但在任何版本的IE中,锚标记都会从URL中剥离,因此我的javascript失败。我正在使用锚定标记来确定应该打开哪个手风琴列表 例如,假设我有 该网站的链接为,主播为:组织者和指导委员会 这是一个使用postname重写的wordpress站点 在.htaccess中,我有: # BEGIN WordPress <IfModule mod_rewrite.c&g

我正在构建一个包含子菜单项的菜单的网站。我的两个子菜单项链接到我的一个页面中的锚定标记。在FF和Chrome中,它们按预期工作,但在任何版本的IE中,锚标记都会从URL中剥离,因此我的javascript失败。我正在使用锚定标记来确定应该打开哪个手风琴列表

例如,假设我有

该网站的链接为,主播为:组织者和指导委员会

这是一个使用postname重写的wordpress站点

在.htaccess中,我有:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
和我的HTML:

jQuery根据锚标记打开相应的手风琴:

<script type="text/javascript">
jQuery(document).ready(function($) {
 var currentHref = window.location.href;
 var anchorLink = currentHref.split("#");
 var accId = anchorLink[1];
  $("div#"+accId+"").parent().addClass('su-spoiler-open');
 document.getElementById(accId).style.display = "block"; 
 });
</script>