我正在尝试让一些 JavaScript 操作在 Internet Explorer 中工作,但到目前为止它们还没有工作。
该脚本使用id
属性来加载与其关联的页面。例如:id="4"
将用于查找页面getinfo.php?vid=4
的值并使用此页面的值来更改站点上的某些内容。
function btcd() {
var id;
$('.btcd').each(function(i) {
id = $(this).attr('id');
id = id.replace('v','');
$(this).load('js/timeleft.php?vid='+id);
});
$('.btp').each(function(i) {
id = $(this).attr('id');
id = id.replace('z','');
$(this).load('js/price.php?vid='+id);
});
$('.button_bied_nu').each(function(i) {
id = $(this).attr('id');
id = id.replace('b','');
$.get('js/you.php?vid='+id, function(data){
var res = data.split(' ');
if(res[1] == '1') {
$('#b'+res[0]).css('background-image','url(images/button_bied_nu_you.png)');
}else{
$('#b'+res[0]).css('background-image','url(images/button_bied_nu.png)');
}
});
});
var d = new Date();
var n = d.getMilliseconds();
setTimeout("btcd()",(900-n));
}
HTML部分:
<div class="veilingen">
<div class="box">
<div class="box_top">
<h3><span class="btcd" id="v1" style="float:right;margin-right:10px">202:50:09</span>Testveiling</h3>
</div>
<div class="box_bg">
<div class="box_image">
<img src="images/veilingen/test.png" alt="Afbeelding" />
<br />
<div class="veiling_lint">
<b>€<span class="btp" id="z1">36</span></b>
<span style="font-size:8pt;">(Elk bod verhoogt de prijs met €1)</span>
</div>
</div>
<a href="#" onclick="bied(1);" class="button_bied_nu" id="b1">BIED NU!</a><br />
Klik <a href="?vid=1">hier</a> voor meer informatie over deze veiling.
</div>
<div class="box_bottom"></div>
</div>