【发布时间】:2011-03-03 13:40:44
【问题描述】:
在我升级到 Jquery 较新版本之前,我的这段代码运行良好。现在我得到了上述错误。
<link rel="stylesheet" type="text/css" href="site.css" />
<link type="text/css" href="css/smoothness/jquery-ui-1.8.10.custom.css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="css/ddsmoothmenu.css" />
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.10.custom.min.js"></script>
<script type="text/javascript" src="js/ddsmoothmenu.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#dialog').dialog({
modal: true,
autoOpen: false,
width: 760,
height: 'auto',
close: function(event, data) {
$('#mainFrame')[0].src = "LoadingPage.aspx";
}
});
$('a[name="dia"]').click(function(){
$('#mainFrame')[0].src = this.file;
$('#dialog').data('title.dialog', this.innerText);
// $('#dialog').data('width.dialog', this.diaWidth);
// $('#dialog').data('height.dialog', this.diaHeight);
$('#dialog').dialog('open');
return false;
});
if (document.getElementById('hidIsAdmin').value == "1"){
document.getElementById('liAdmin').style.display = 'block';
document.getElementById('liReports').style.display = 'block';
}else {
$('#liAdmin').remove();
$('#liReports').remove();
}
if (document.getElementById('hidCreate').value == "1"){
document.getElementById('liCreate').style.display = 'block';
}else {
$('#liCreate').remove();
$('.edit_icon_link').hide(0);
}
});
function hideEditIcon(){
$('.edit_icon_link').hide(0);
}
</script>
【问题讨论】:
-
您使用的 jQuery UI 版本是否与 jQuery 版本兼容?您可能需要下载更新的版本。
-
你到底升级了什么?什么文件?
-
我将 jquery-1.3.2.min.js 更改为 jquery-1.4.4.min.js 并将 jquery-ui-1.7.1.custom.min.js 更改为 jquery-ui-1.8。 10.custom.min.js 和 css jquery-ui-1.7.1.custom.css 到 jquery-ui-1.8.10.custom.css。就这样。它在以前的版本中运行良好。
-
确保文件确实是使用 HttpWatch 加载的。
-
这是以前使用旧文件名和现在使用新文件名的方式。