解決辦法是Jquery創(chuàng)建HTML 元素對(duì)象,然后append HTML 內(nèi)容,返回相應(yīng)的Jquery新的對(duì)象,類似于拷貝完成。
創(chuàng)新互聯(lián)是一家專注于網(wǎng)站建設(shè)、網(wǎng)站設(shè)計(jì)與策劃設(shè)計(jì),左云網(wǎng)站建設(shè)哪家好?創(chuàng)新互聯(lián)做網(wǎng)站,專注于網(wǎng)站建設(shè)10年,網(wǎng)設(shè)計(jì)領(lǐng)域的專業(yè)建站公司;建站業(yè)務(wù)涵蓋:左云等地區(qū)。左云做網(wǎng)站價(jià)格咨詢:18982081108
原來(lái)代碼
[javascript] view plaincopyprint?
//var templateInsTotal = $("#tr_sample_one_biz:first", tab).clone();
//templateTwo = $("#tr_sample_two_biz:first").clone();
現(xiàn)在代碼
[javascript] view plaincopyprint?
var templateInsTotal = createTrElement($("#tr_sample_one_biz:first", tab));
var templateTwo = createTrElement($("#tr_sample_two_biz:first", tab));
function createTrElement(cloneObj) {
try {
if (cloneObj != null) {
var newObj = $("tr/tr");
newObj.append($(cloneObj).html());
newObj.attr("id", $(cloneObj).attr("id"));
newObj.attr("style", $(cloneObj).attr("style"));
newObj.attr("alltrusttag", $(cloneObj).attr("alltrusttag"));
newObj.attr("alltrustid", $(cloneObj).attr("alltrustid"));
return newObj;
}
} catch (e) {
alert(e);
}
return null;
}
jQuery1.x版本的框架時(shí)兼容所有IE瀏覽器的,而2.x版本的jQuery框架并不支持低端IE瀏覽器。此處的低端IE瀏覽器指的是IE8版本以及8版本以下。所以,對(duì)于需要全兼容的項(xiàng)目,就不得不使用1.x版本啦。
資料來(lái)源:HTML5學(xué)堂(wx+號(hào))
jQuery新版本已經(jīng)不再進(jìn)行IE低版本(IE6、IE7、IE8)的兼容性處理。
如果項(xiàng)目需要兼容IE低版本,需要使用jQuery1.x版本,從2.x開(kāi)始已經(jīng)不兼容IE6、7、8了。
以下為jQuery官網(wǎng)的通知:
jQuery 2.x has the same API as jQuery 1.x, but does not support Internet Explorer 6, 7, or 8. All the notes in the jQuery 1.9 Upgrade Guide apply here as well. Since IE 8 is still relatively common, we recommend using the 1.x version unless you are certain no IE 6/7/8 users are visiting the site. Please read the 2.0 release notes carefully.
翻譯如下:
jQuery 2.x和jQuery的API用法相同,但是不再支持IE6、7、8。
1.9版本中的所有升級(jí)向?qū)畔⑼瑯舆m用于2.x
由于IE8仍然用戶較多,因此建議使用1.x版本,除非確定沒(méi)有用IE6、7、8的用戶訪問(wèn)網(wǎng)站。
請(qǐng)仔細(xì)閱讀2.0的發(fā)布信息。
jQuery 1.x 支持IE6-8,2.0及以上不再支持IE8。
jQuery 1.x最新的版本是1.12.
以下是jQuery官網(wǎng)上的說(shuō)明:
If you need to support older browsers like Internet Explorer 6-8, Opera 12.1x or Safari 5.1+, use?jQuery 1.12.
當(dāng)前文章:jqueryie兼容,jquery兼容性
本文鏈接:http://chinadenli.net/article30/dsdgopo.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App設(shè)計(jì)、定制網(wǎng)站、ChatGPT、網(wǎng)站收錄、云服務(wù)器、動(dòng)態(tài)網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)