简体   繁体   English

Internet Explorer忽略Javascript

[英]Internet Explorer ignores Javascript

I've recently been trying to include a Lightbox-Clone called "EnlargeIt" into my website. 我最近一直在尝试将名为“ EnlargeIt”的灯箱克隆包含到我的网站中。 Everything works fine in every Browser except, big surprise, Intenret Explorer. 在所有浏览器中,一切正常,但令人惊讶的是Intenret Explorer。 Let me quote directly from the manual: 让我直接从手册中引用:

Integrate your thumbnails like this into the of your web page: 将这样的缩略图集成到网页的中:

<a href=”images/fullsize_file.jpg” target=”_blank” onclick=”return false;”><img 
src="images/thumb_file.jpg" alt="My first picture" onclick="enlarge(this);" 
longdesc="images/fullsize_file.jpg" /></a> 

The attribute longdescis used for the qualified filename of the full size image, meaning that if the file is in a different folder, the correct pathmust be included (in the example, it's images/). longdescis属性用于完整尺寸图像的合格文件名,这意味着如果文件位于其他文件夹中,则必须包括正确的路径(在示例中为images /)。 The attribute altis used for the picture caption. 用于图片标题的属性altis。 If you don't define it or leave it empty, no caption (title bar text) will be displayed for thispicture. 如果您未定义它或将其保留为空白,则此图片将不显示标题(标题栏文本)。 Around the image, there's an …element linking to the full size image in a new window (target=”_blank”). 在图片周围,有一个...元素链接到新窗口中的全尺寸图片(target =“ _ blank”)。 It's very important, that you set the attribute onclick=”return false;”. 非常重要的一点是,您将属性设置为onclick =“ return false;”。 This way, the link won't be used if Javascript is available. 这样,如果有Javascript,则不会使用该链接。

I've done exactly as said in this manual and it works fine until you try it with IE9. 我已经完全按照本手册中所述进行了操作,并且在您尝试使用IE9之前,它都可以正常工作。 You click on it and it does...nothing at all. 您单击它,它什么都没有。 Every other Browser handles it correctly, even older versions of IE. 其他所有浏览器都可以正确处理它,即使是较旧版本的IE。 It does show the link while hovering over it but I guess the "return false" prevents the default action? 当鼠标悬停在链接上时,它确实显示了链接,但是我猜“ return false”阻止了默认操作?

My Code: 我的代码:

<a href="fileadmin/templates/HTML/main.html" target="_blank" onclick="return false;"/><img src="fileadmin/templates/images/logo_subline_moreInformation.jpg" style="width: 520px; height: 130px; cursor:pointer;border:none;border-width:0px;text-decoration:none;" alt="Alt" id="Image"
  onclick="enlarge(this);" longdesc="ifr::fileadmin/templates/HTML/main.html::800::600"/></a><br>

Thank you! 谢谢!

Oh and have a nice day! 哦,祝你有美好的一天!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM