简体   繁体   English

IE的JavaScript问题

[英]JavaScript problems with IE

I'm trying to make some JavaScript actions work in Internet Explorer but so far they aren't working. 我正在尝试使一些JavaScript操作在Internet Explorer中起作用,但到目前为止它们没有起作用。

The script uses the id atrribute to load a page associated to it. 该脚本使用id属性来加载与其关联的页面。 For example: id="4" will be used to look up the value of the page getinfo.php?vid=4 and uses the value of this page to change something on the site. 例如: 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));
}

The HTML part: 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>&euro;<span class="btp" id="z1">36</span></b>
                <span style="font-size:8pt;">(Elk bod verhoogt de prijs met &euro;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>

The page itself: http://project.browsertech.nl/001/index.php 页面本身: http : //project.browsertech.nl/001/index.php

I reckon this is working but caching. 我认为这是可行的,但可以缓存。 Either use a different ajax call or you could drop this whammy code in: 您可以使用其他的ajax调用,也可以将以下糟糕的代码放入:

$.ajaxSetup ({
    cache: false
});

Which will stop the load cache (as well as any jQuery ajax call caches) 这将停止加载缓存(以及所有jQuery ajax调用缓存)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM