2013-08-02 46 views
0

我在IE8中得到了这个代码第5行的“Objected Expected”,代码在Firefox中工作,但不是IE 8,这是我正在开发的浏览器。谢谢。对象预期错误Javascript/Jquery

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"> 
</script>  
<script language="javascript"> 

$(document).ready(function(){ 
if($('#DialogFinalMessage > div').html().length>0){ 
    window.location.href = "<Desired destination page URL>" 
} 
}); 
</script> 
+1

什么是你的代码行5? – putvande

+0

$(document).ready(function(){ –

+0

真的吗?'',''等等。或者它只在这一行代码行中吗? – putvande

回答

1

问题:Demo

尝试

$(document).ready(function(){ 
    var html = $('#DialogFinalMessage > div').html(); 
    if(html != undefined && html.length > 0){ 
     window.location.href = "" 
    } 
}); 

演示:Fiddle

0

尝试<script type="javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">