0

クロスブラウザの問題が少しあります。コードを IE で動作させることができないようです。誰かがエラーを見つけることができれば、私はそれを非常に感謝しています:

$(document).ready(function() {
    var timerId = 0;
    $('#timerwrap').ready(function() {
        $('#timerwrap').html("Please wait <strong id='show-time'>5</strong>");
        console.log(timerId)
        if (timerId == 0) {
            timerId = window.setInterval(function() {
                var timeCounter = $("#show-time").html();
                var updateTime = parseInt(timeCounter, 10) - 1;
                $("#show-time").html(updateTime);
                if (updateTime <= 0) {
                    clearTimeout(timerId);
                    $('#timerwrap').html("<a href='http://2ga.in/push/<?php echo("$item[seo]"); ?>/' target='_parent' title='Continue to <?php echo("$item[title]"); ?>'>Continue to...</a>");
                }
            }, 1000);
        }
    });
});​
4

1 に答える 1

0
I am not sure for solutions without full requirement or preview, but i found that it's showing an error because of using "" twice in "" so try with edited as below.

<script type="text/javascript">
// Only create tooltips when document is ready
$(document).ready(function() {
    var timerId = 0;
    $('#timerwrap').ready(function() {
        $('#timerwrap').html("Please wait <strong id='show-time'>5</strong>");
        console.log(timerId)
        if (timerId == 0) {
            timerId = window.setInterval(function() {
                var timeCounter = $("#show-time").html();
                var updateTime = parseInt(timeCounter, 10) - 1;
                $("#show-time").html(updateTime);
                if (updateTime <= 0) {
                    clearTimeout(timerId);
                    $('#timerwrap').html("<a href='http://2ga.in/push/<?php echo('$item[seo]'); ?>/' target='_parent' title='Continue to <?php echo('$item[title]'); ?>'>Continue to...</a>");
                }
            }, 1000);
        }
    });
});
</script> 
于 2013-08-14T12:59:49.770 に答える