我在Jquery中得到腳本錯誤。請建議如何解決此問題。顯示的腳本錯誤消息是「HTML解析錯誤:在子元素關閉之前無法修改父容器元素」。 代碼:0線:0炭:0。我的jQuery代碼是:JQuery中的腳本錯誤
<script type="text/javascript">
(function($) {
var search=window.location.search.substring(1);
var page=search.split("=");
var location=window.location.toString();
var url=location.split('?')[0];
if(page[1]=='custDetails'){
$(document).ready(function(){
$('#message').dialog('open');
$(document).ready(function(){
$('#pop').click(function(){
$('#message').dialog('open');
return false;
});
});
});
} // end of if
else {
$(document).ready(function(){
$('#pop').click(function(){
$('#message').dialog('open');
return false;
});
});
} // end of else
$('#message').dialog({
width:200,
autoOpen:false,
buttons:{
Close:function() {
$ (this.dialog('close');
$ ('#message').replaceWith('url');
}
}
});
$('#page').click((function(event){
window.print();
});
}) ($);
</script>
當我刪除$( '#消息')對話框({});組件它不會拋出腳本錯誤。請告訴我原因。
請格式化您的代碼 – epignosisx 2011-12-16 12:52:14
...幷包含錯誤消息。 – 2011-12-16 12:53:27