I am developing a site using pinax. In one of my templates I am trying to open a simple jquery dialog box. However I keep getting the "Dialog not a function" javascript error. I am using jquery 1.2.6 and jquery-ui 1.6. My javascript and HTML are as follows:
<html>
<head>
<link type="text/css" href="/site_media/smoothness/ui.all.css" rel="stylesheet" />
<script src="/site_media/jquery.js" type="text/javascript"></script>
<script src="/site_media/ui/ui.core.js" type="text/javascript"></script>
<script src="/site_media/ui/ui.draggable.js" type="text/javascript"></script>
<script src="/site_media/ui/ui.resizeable.js" type="text/javascript"></script>
<script src="/site_media/ui/ui.dialog.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#dialogbox').dialog();
});
</script>
</head>
<body>
<div id="dialogbox" title="dialog title">
<p>Test dialog</p>
</div>
</body>
</html>
Can someone please explain why this is happening?
I tried to duplicate your error both by using the public google versions and by downloading the legacy (1.6) version from the jQuery UI site and manually including the files. Neither caused a problem (http://jsbin.com/uloqi to see it working).
So, that means one of the following might solve your problem:
I don't know what else to tell you since the code you pasted, when paired with the right files, works perfectly.
I had the exact same problem as the one described above (messagebox only opens once). The problem i had was that the html in the messagebox also loads jquery. Since i don't needed it i could remove it without problems. Otherwise you might have to pin down the problem a bit further.
Under certain circumstances you can get this error if multible and different JQuery version are loaded at the same time.
In my case I has a ASP page that used a master. My master was including JQuery 1.4.2.min My aspx page I included JQuery 1.7.2.min
When JQuery functions were called from a control, it got confused about which JQuery to use so even though that script could state that JQuery was loaded ( it could display the JQuery version ), it failed to find any JQuery functions.
When I removed my local JQuery 1.7.2.min inclusion out of my aspx file, and updated my mater from 1.4.2.min to 1.7.2.min, the problem went away.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With