开发者

Replacing text with image invokes "IE has restricted this page from running scripts or ActiveX"

开发者 https://www.devze.com 2023-01-03 04:07 出处:网络
I\'m making a snippet that people can add to their web sites. My problem is that it invokes the yellow \"ActiveX\" bar at the top in Internet explorer. I\'m not sure what invokes it. This is my code:

I'm making a snippet that people can add to their web sites. My problem is that it invokes the yellow "ActiveX" bar at the top in Internet explorer. I'm not sure what invokes it. This is my code:

<a id="nhl1" href="http://www.theaddress.com/">link</a>
<script type="text/javascript"> 
(function () { document.getElementById('nhl1')开发者_如何学运维.innerHTML = 
'<img src="http://www.theaddress.com/banner1.jpg" alt="image 1" style="border: none;" />'; })(); 
</script>


If you're running the page in the local machine, this will happen when there is a script on the page. The actual message is:

To help protext your security, Internet Explorer has restricted this webpage from running scripts or ActiveX controls that could access your computer. Click here for options...

[emphasis mine]

If you run the same page on a webserver, you will not see the yellow warning bar.

0

精彩评论

暂无评论...
验证码 换一张
取 消