gpt4 book ai didi

javascript - 此 javascript 适用于除 Internet Explorer 之外的所有浏览器!

转载 作者:行者123 更新时间:2023-11-30 07:18:47 25 4
gpt4 key购买 nike

网页在这里: http://develop.macmee.com/testdev/

我说的是当你点击 ?在左侧,它应该打开一个包含更多内容的框。它在除 IE 之外的所有浏览器中都这样做!

function question()
{
$('.rulesMiddle').load('faq.php?faq=rules_main',function(){//load page into .rulesMiddle

var rulesa = document.getElementById('rulesMiddle').innerHTML;
var rules = rulesa.split('<div class="blockbody">');//split to chop off the top above rules

var rulesT = rules[1].split('<form class="block');//split to chop off below rules
rulesT[0] = rulesT[0].replace('class=','vbclass');//get rid of those nasty vbulletin defined classes
document.getElementById('rulesMiddle').innerHTML = rulesT[0];//readd the content back into the DIV
$('.rulesMain').slideToggle();//display the DIV
$('.rulesMain').center();//center DIV
$('.rulesMain').css('top','20px');//align with top
});
}

最佳答案

IE 将 innerHTML 内容转换为大写,因此您可能无法以这种方式拆分字符串,因为字符串操作区分大小写。通过运行检查内容的真实情况

alert(rulesa);

关于javascript - 此 javascript 适用于除 Internet Explorer 之外的所有浏览器!,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2860308/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com