Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery UI 1.8.10 Cannot read property '3' of undefined

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>';
        }

?>

why does this give a cannot read property '3' of undefined error?

the file that gives the error is 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>';
}
}
 ?>

But still the same error

like image 568
Jelle Dijkhuizen Avatar asked Aug 14 '12 07:08

Jelle Dijkhuizen


2 Answers

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

example here :

http://jsfiddle.net/techunter/RyUVq/

like image 168
TecHunter Avatar answered Oct 01 '22 23:10

TecHunter


You found a bug/incompatibility!!

this isn't working jquery (1.8.0): http://jsfiddle.net/mZPWS/

Older jquery version (1.7.2) is working: http://jsfiddle.net/mZPWS/1/

like image 31
VDP Avatar answered Oct 02 '22 00:10

VDP