Seph
Seph

Reputation: 786

JavaScript problems with IE

I'm trying to make some JavaScript actions work in Internet Explorer but so far they aren't working.

The script uses the id atrribute to load a page associated to it. 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.

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:

<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

Upvotes: 1

Views: 98

Answers (1)

Stuart Burrows
Stuart Burrows

Reputation: 10814

I reckon this is working but caching. Either use a different ajax call or you could drop this whammy code in:

$.ajaxSetup ({
    cache: false
});

Which will stop the load cache (as well as any jQuery ajax call caches)

Upvotes: 1

Related Questions