火狐对innerHtml的支持问题
最新的Firefox是支持innerHTML的,但是不支持innerText。解决办法是将innerText换成textContent。
$.getJSON("/api/Articles", { page: page.PageValue, _class: "联合动态" }, function (data) { var i = 0; $("#divID")[0].innerHTML = ""; $.each(data.Articles, function (i, v) { if (i == 3) { $("#divID")[0].innerHTML += "</br></br></br>"; } $("#divID")[0].innerHTML += "<a href='' id='a" + i + "' ><img id='image" + i + "' src='' onload='ReSizePic(this);' /></a>"; $("#divID")[0].innerHTML += "<p class='bgcolor' id='p" + i + "'></p>"; $("#divID")[0].innerHTML += "<p class='bgtext' id='pl" + i + "'></p>"; $("#a" + i).attr({ href: "/ReceptionArticle/Details/" + v.Id }); $("#image" + i).attr({ src: v.Img }); $("#p" + i)[0].textContent = v.Title; $("#pl" + i)[0].textContent = v.Time.toString().substring(0, 9); i++; } ); self.pages.removeAll(); $.each(data.Page, function (i, v) { self.pages.push(v); }); });