0
我真的是ajax/jquery的初學者。我需要在「target = _blank」之類的新窗口中打開一個鏈接,但我的代碼只能讓鏈接在同一個窗口中打開。我已經嘗試了不同的東西,例如在jQuery中插入target _blank,但它根本不起作用。我真的很感謝你試過這種的幫助[:)如何在ajax代碼中添加「_blank」屬性?
function initHeroSwitch() {
var heroCnt = $('#hero ul li').size();
if ($('#hero').length > 0) {
$('#hero').append('<div id="hero-btns"></div>');
$('#hero ul li').each(function (index) {
$('#hero-btns').append('<a href="" rel="' + (index) + '"></a>'); });
$('#hero ul li').each(function() {
getRel = $(this).attr('rel');
winHeight = $(window).height();
if (winHeight > 750) {
var bkgImg = getRel.split('.');
bkgImg = bkgImg[0];
bkgImg = bkgImg.substr(0, bkgImg.length - 3);
bkgImg = bkgImg + "-lg.jpg";
$('#hero ul li').each(function() { preload(bkgImg); });
} else {
preload(getRel);
}
});
startHeroRotate();
rotateHero(rotateSpeed);
} else { autoRotate = window.setInterval(function() { startNewsRotation(); }, rotateSpeed); }
}
哎mrchief,感謝您試用,但我已經嘗試過這一點....東西是當我點擊一個鏈接,它應該打開一個新的窗口,但現在的方式是重定向追加到我的主機在同一個窗口,奇怪的是,當我點擊後退按鈕它會自動再次鏈接到o_O – struts
這聽起來就像網頁上的某些內容在全球範圍內一樣你可以發佈你的標記和更多細節,瞭解誰在做重定向以及如何做? – Mrchief
我正在調查全球的CSS,謝謝 – struts