2012-05-21 3 views
0

У меня проблема с несколькими перекрестными браузерами. Кажется, я не могу заставить свой код работать в IE. Если кто-то может обнаружить ошибку, я бы очень признателен:Проблема с браузером с IE и сценарием jQuery

$(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); 
     } 
    }); 
});​ 
+1

что код должен делать? что не так? –

+0

Его код обратного отсчета –

+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> 
Смежные вопросы