开发者

Javascript Redirect Not Working

开发者 https://www.devze.com 2023-02-22 23:03 出处:网络
I have the below code in a HTML page on my site.The u开发者_如何学运维rl parameter is loading fine on a pixel fire right above it but for some reason the redirect doesn\'t want to fire.Anyone have any

I have the below code in a HTML page on my site. The u开发者_如何学运维rl parameter is loading fine on a pixel fire right above it but for some reason the redirect doesn't want to fire. Anyone have any ideas? It might be an IE issue but not sure.

<script type="text/javascript">
$(document).ready(function() { 
    setInterval("window.location = '{{$url}}'", 4000);
});
</script>


<script type="text/javascript">
var url = '...';
$(document).ready(function() { 
    setInterval(function() {
                 window.location.href = url;
                 }, 4000);
});
</script>
0

精彩评论

暂无评论...
验证码 换一张
取 消