JQuery UI 1.8.10无法读取未定义的属性"3" [英] JQuery UI 1.8.10 Cannot read property '3' of undefined
本文介绍了JQuery UI 1.8.10无法读取未定义的属性"3"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用的是JQuery UI 1.8.10和最新的jquery.
I use JQuery UI 1.8.10 and jquery latest.
我的代码是:
My code is:
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.js"></script>
<script type="text/javascript" src="/cms/ww.admin/login/login.js"></script>
</head>
<body>
<div id="header"></div>
<?php
if(isset($_REQUEST['login_msg']))
{
require SCRIPTBASE.'cms/ww.incs/login-codes.php';
$login_msg = $_REQUEST['login_msg'];
if(isset($login_msg_codes[$login_msg]))
{
echo '<script>$(function(){$("<strong>'.htmlspecialchars($login_msg_codes[$login_msg]).'</strong>").dialog({modal:true});});</script>';
}
?>
这为什么会产生无法读取的未定义错误的属性"3"?
why does this give a cannot read property '3' of undefined error?
给出错误的文件是jquery-ui.js on line 186
好吧,现在我将其更改为:
okay now i changed it to:
</head>
<body>
<div id="header"></div>
<div id="login-msg"></div>
<?php
if(isset($_REQUEST['login_msg'])){
require SCRIPTBASE.'cms/ww.incs/login-codes.php';
$login_msg=$_REQUEST['login_msg'];
if(isset($login_msg_codes[$login_msg])){
echo '<script>$(function(){
$("#login-msg").html("<strong>'.htmlspecialchars($login_msg_codes[$login_msg]).'</strong>").dialog({modal:true});});</script>';
}
}
?>
但仍然是相同的错误
推荐答案
这是jQueryUI中的一个错误,该错误使用了:data选择器(如果您进入调用堆栈,则会看到它),该选择器已过时/不兼容最新的jQuery. 尝试使用此jQueryUI:
It's a bug from your jQueryUI which use a :data selector (if you go up in the call stack you will see it) which is deprecated/not compatible with latest jQuery. Try with this jQueryUI :
http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.22/jquery-ui.min.js
此处的示例:
http://jsfiddle.net/techunter/RyUVq/
这篇关于JQuery UI 1.8.10无法读取未定义的属性"3"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文