简体   繁体   English

JavaScript / Jquery IE8问题,IE8上的Click事件不起作用,为什么?

[英]JavaScript / Jquery IE8 Issue, Click event on IE8 does not work, why?

The problem I have is that the program I have is not working correctly in IE8 for some people. 我的问题是某些人无法在IE8中正常运行该程序。 The website is an English course and in IE8 for some people you are unable to click on the correct answers. 该网站是英语课程,对于某些人来说,在IE8中您无法单击正确的答案。 Take a look at the following video: http://screencast-o-matic.com/watch/cXllIjvxW 观看以下视频: http : //screencast-o-matic.com/watch/cXllIjvxW

Take a look and you will see the user is trying to click but it is not working. 看一看,您将看到用户正在尝试单击,但是它不起作用。 Take a closer look yourself and login to http://www.fcecourse.com/grammar-fce?m=11 with the username digital and the password digital . 请仔细看一下并使用用户名digital和密码digital登录到http://www.fcecourse.com/grammar-fce?m=11 Then click on unit 1 (01) , then click on exercise, then on start ... here is another video: http://screencast-o-matic.com/watch/cXllD9v4D 然后单击单元1(01),然后单击运动,然后单击开始...这是另一个视频: http : //screencast-o-matic.com/watch/cXllD9v4D

The strange thing is that I have tested this and others have tested it and it is working fine in IE8, in windows 7, but other people I know are getting this problem are unable to click on the correct answers. 奇怪的是,我已经对此进行了测试,而其他人已经对其进行了测试,并且在Windows 8的IE8中工作正常,但是我知道遇到此问题的其他人无法单击正确的答案。 I need a solution. 我需要一个解决方案。

Hey i had like a couple of weeks ago the same problem and taking just a little look inside your html i see you have this: 嘿,我像几个星期前一样遇到了同样的问题,并且只是在html内稍作浏览,所以看到了这个问题:

<a onclick="javascript:comprobar('has', 'r-25529');" href="javascript:;">has</a>

the problem i had with internet explorer 7 and 8 was because i was calling my javascript function in the onload attribute of the anchore instead of bind the event with jquery and later do your stuff i fix this like this: 我使用Internet Explorer 7和Internet Explorer 8时遇到的问题是,因为我在锚定的onload属性中调用了我的javascript函数,而不是将事件与jquery绑定在一起,后来又做了一些事情,我像这样来解决:

<a id="answer" href="javascript:;" number="25529" >has</a>

and later(Edited): 及更高版本(编辑):

$('.answer').live('#answer', function(e){
    e.preventDefault();
    var link_prefix = "r-"; //prefix of the link to check
    var link_number = $(this).attr('number'); //obtaining the number attribute from the link
    var completeLink = link_prefix + link_number;
    comprobar('has', completeLink);//the onclick stuff here
})

and that should be work on ie 7 and 8 i promise in this way you can obtain the value of the clicked link bassed in a class. 并且应该在即7和8上工作,我保证您可以通过这种方式获得在类中低音的单击链接的值。

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

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