php - JQuery popup.....Uncaught TypeError: Object [object Object] has no method 'dialog' -
i have been searching solution problem few days , have gained few grey hairs in process. echoing jquery popup script in php:
echo '<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> <script src="functions.js"></script> <script type="text/javascript"> $(document).ready(function() { jqueryalert("insert message here!", 120); }); </script>';
the problem is, fires , doesn't. when doesn't fire outputs following error message in chromes js console: uncaught typeerror: object [object object] has no method 'dialog'
from can discern similar questions(uncaught typeerror: object #<object> has no method 'dialog'), problem duplicate call of javascript library, however, have eliminated possibility whittling javascript libraries bare minimum(any less , won't able function). idea causing this?? eternally grateful can provide solution!!
this isn't fix, since can't see rest of code, here potential workaround, check if dialog function exists, if so, create alert, if not, wait 100 milliseconds, , try again:
$(document).ready(function() { function jqalert(msg) { if (typeof($.fn.dialog) != 'undefined') jqueryalert(msg, 120); else settimeout(function() { jqalert(msg); }, 100); } jqalert("insert message here!"); });
Comments
Post a Comment