jQuery load()在IE8及更高版本中不起作用7 [英] jQuery load() doesn't work in IE8 & 7

查看:219
本文介绍了jQuery load()在IE8及更高版本中不起作用7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行此代码

$j('#nav_menu-2 li li a').bind('click', function(e){ 
    //check when pagination link is clicked and stop its action.
    e.preventDefault();

    //get the href attribute
    var link = $j(this).attr('href');

    $j('#content').load(link + ' #content');
});

它在chrome,ff,ie9中可以正常工作,但问题始于ie8和ie7.

its working fine in chrome, ff, ie9 but the problems begin with ie8 and ie7.

我在网上搜索并尝试过这种方式

I searched the web and tried this way

$j('#content').load(link + '?' + Math.random()*99999 + ' #content');

,但仍无法正常工作,内容仅不显示.
这是网站的网址

but its still not working, the content just doesn't show.
this is the url to the site

只需单击第一个蓝色框(箭头1),然后尝试更改箭头2和箭头3的内容.

just click the first blue box(arrow 1), and try to change the content the arrow 2 and arrow 3.

推荐答案

问题是html代码中多余的</div>标记. 所有现代的浏览器都能够处理此问题,但是显然ie8和7简直就是一团糟.

the problem was an extra unneeded </div> tag inside the html code. All the modern browsers was able to handle this, but apparently ie8 and 7 just got lost that mess.

这篇关于jQuery load()在IE8及更高版本中不起作用7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆