Internet Explorer 8阻止了CSS,JQuery

时间:2022-05-18 17:07:27

I'm in the process of developing a website that makes use of JQuery's superfish. Now if I want to test it in Internet Explorer 8 I'm getting the messageTo help protect your security, Internet Explorer has restricted this webpage from running scripts or ActiveX controls that could access your computer in firefox everything runs smoothly. My code is below

我正在开发一个使用JQuery的超级鱼的网站。现在,如果我想在Internet Explorer 8中测试它我收到消息为了帮助保护您的安全,Internet Explorer已经限制此网页运行脚本或ActiveX控件可以访问您的计算机在firefox中运行顺利。我的代码如下

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>site</title>


<link rel="stylesheet" type="text/css" href="css/site.css">
<link rel="stylesheet" type="text/css" href="css/superfish.css" media="screen">
<link rel="stylesheet" type="text/css" media="screen" href="css/superfish-navbar.css" />
<script type="text/javascript" src="js/jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="js/hoverIntent.js"></script>
<script type="text/javascript" src="js/superfish.js"></script>
<script type="text/javascript">

    jQuery(function(){
         $("ul.sf-menu").superfish({ 
             delay:         0,
             speed:         'fast',
             autoArrows:    false,
             dropShadows:   false,
        });
    });

</script>

</head>

if I remove the following code it works fine

如果我删除以下代码,它工作正常

<link rel="stylesheet" type="text/css" href="css/site.css">
<link rel="stylesheet" type="text/css" href="css/superfish.css" media="screen">
<link rel="stylesheet" type="text/css" media="screen" href="css/superfish-navbar.css" />
<script type="text/javascript" src="js/jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="js/hoverIntent.js"></script>
<script type="text/javascript" src="js/superfish.js"></script>
<script type="text/javascript">

        jQuery(function(){
             $("ul.sf-menu").superfish({ 
                 delay:         0,
                 speed:         'fast',
                 autoArrows:    false,
                 dropShadows:   false,
            });
        });

    </script>

if I only leave in the first css line I'm getting the error again, thus leaving only

如果我只留在第一个css行,我再次收到错误,因此只留下

<link rel="stylesheet" type="text/css" href="css/site.css">

Are there any solutions to this? I don't want my visitors to click on allow everytime the access the site ;-( Clueless here

这有什么解决方案吗?我不希望我的访问者每次访问网站时都点击允许;-(此处无能为力

2 个解决方案

#1


11  

I suspect this is because you are running this script locally. IE blocks scripts (and I guess CSS, which can run scripts with expression) for web pages on the hard drive in order to help stop viruses.

我怀疑这是因为你在本地运行这个脚本。 IE为硬盘驱动器上的网页阻止脚本(我猜CSS可以运行带有表达式的脚本),以帮助阻止病毒。

Try uploading it to a remote server, or setting up a web server at http://localhost/. You probably shouldn't have those issues once not using file:\\\. You can also change your local intranet security settings to prevent these warnings, but I'd recommend against it; they're set by default for a reason. Your call.

尝试将其上传到远程服务器,或在http:// localhost /上设置Web服务器。一旦不使用file:\\\,您可能不应该遇到这些问题。您还可以更改本地Intranet安全设置以防止出现这些警告,但我建议您不要这样做;出于某种原因,它们默认设置。你的来电。

#2


6  

Running the site in the local zone is what's causing your problem. If you want to continue testing locally, you can use a Mark of the Web:

在本地区域中运行该站点是导致您的问题的原因。如果要继续在本地进行测试,可以使用Web标记:

<!-- saved from url=(0022)http://www.example.com/ -->

The parenthesized number should be 4 digits specifying the length of the URL.

带括号的数字应为4位数,指定URL的长度。

This will force IE to run the site in the security zone that applies to the domain specified. Just remember to remove it when you upload your site for production, although leaving it in would have no detrimental effect.

这将强制IE在适用于指定域的安全区域中运行该站点。只需记住在上传您的网站进行生产时将其删除,但保留该网站不会产生任何不利影响。

#1


11  

I suspect this is because you are running this script locally. IE blocks scripts (and I guess CSS, which can run scripts with expression) for web pages on the hard drive in order to help stop viruses.

我怀疑这是因为你在本地运行这个脚本。 IE为硬盘驱动器上的网页阻止脚本(我猜CSS可以运行带有表达式的脚本),以帮助阻止病毒。

Try uploading it to a remote server, or setting up a web server at http://localhost/. You probably shouldn't have those issues once not using file:\\\. You can also change your local intranet security settings to prevent these warnings, but I'd recommend against it; they're set by default for a reason. Your call.

尝试将其上传到远程服务器,或在http:// localhost /上设置Web服务器。一旦不使用file:\\\,您可能不应该遇到这些问题。您还可以更改本地Intranet安全设置以防止出现这些警告,但我建议您不要这样做;出于某种原因,它们默认设置。你的来电。

#2


6  

Running the site in the local zone is what's causing your problem. If you want to continue testing locally, you can use a Mark of the Web:

在本地区域中运行该站点是导致您的问题的原因。如果要继续在本地进行测试,可以使用Web标记:

<!-- saved from url=(0022)http://www.example.com/ -->

The parenthesized number should be 4 digits specifying the length of the URL.

带括号的数字应为4位数,指定URL的长度。

This will force IE to run the site in the security zone that applies to the domain specified. Just remember to remove it when you upload your site for production, although leaving it in would have no detrimental effect.

这将强制IE在适用于指定域的安全区域中运行该站点。只需记住在上传您的网站进行生产时将其删除,但保留该网站不会产生任何不利影响。