Jquery Append()在IE中不起作用
我正在尝试在我的网站中动态加载HTML内容。它适用于除IE8之外的所有浏览器 我的jQuery:Jquery Append()在IE中不起作用,jquery,internet-explorer,append,innerhtml,Jquery,Internet Explorer,Append,Innerhtml,我正在尝试在我的网站中动态加载HTML内容。它适用于除IE8之外的所有浏览器 我的jQuery: $(document).ready(function() { var mycontent14dec = '<a href="http://www.youtube.com/mtsconnects" target="_blank"><img src="../sliderbanners/nh7-livestreaming.jpg" width="589" height="30
$(document).ready(function() {
var mycontent14dec = '<a href="http://www.youtube.com/mtsconnects" target="_blank"><img src="../sliderbanners/nh7-livestreaming.jpg" width="589" height="309" /></a>'
+ '<a href="../events/nh7/index.html"><img src="../sliderbanners/nh7-1.jpg" width="589" height="309" /></a>'
+ '<a href="../events/nh7/index.html"><img src="../sliderbanners/nh7-2.jpg" width="589" height="309" /></a>'
+ '<a href="http://www.mtsindia.in/justdongle/" target="_blank"><img src="../sliderbanners/Diwali_festival.jpg" width="589" height="309" /></a>';
$(".addhtml").append(mycontent14dec);
});
$(文档).ready(函数(){
var mycontent14dec=“”
+ ''
+ ''
+ '';
$(“.addhtml”).append(mycontent14dec);
});
我的HTML:
<div class="addhtml"></div>
这可能是您格式化变量的方式,trey将html放在一个字符串中,全部放在一行上,如果它起作用,那就是您的问题。问题在于javascript类型,即只支持TYPE=text/javascript
@Matanya感谢您指出:)您有任何错误吗?你能设置一个JSFIDLE吗?这可能会解决你的问题:这是我的小提琴help@Matanya实际上我使用的是这个(text/javascript是所有浏览器中唯一受支持的类型。完全省略该类型,因为它默认为text/javascript):