Can jQuery UI be used with web.py? With jQuery and web.py, you can trigger events using jQuery or $$ (because $ is used by web.py for template variables) – but the same does not seem to be true with jQuery UI.
I get the following error from the code below: jQuery(“#dialog”).dialog is not a function. The same code executes correctly outside of web.py framework.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>jQuery UI Example Page</title>
<script src="http://code.jquery.com/jquery-1.7.1.min.js" type="text/javascript"></script>
<script src="/usr/local/pos/templates/jquery-ui-1.8.18.custom.min.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(function(){
// Dialog
jQuery('#dialog').dialog({
autoOpen: false,
width: 600,
buttons: {
"Ok": function() {
jQuery(this).dialog("close");
},
"Cancel": function() {
jQuery(this).dialog("close");
}
}
});
// Dialog Link
jQuery('#dialog_link').click(function(){
jQuery('#dialog').dialog('open');
return false;
});
});
</script>
</head>
<body>
<h1>Hello</h1>
<h2>Dialog</h2>
<a href="#" id="dialog_link">Open Dialog</a>
<!-- ui-dialog -->
<div id="dialog" title="Dialog Title">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
</div>
</body>
</html>
You are probably not properly loading jQuery UI.
looks like it should be a http URL instead – you don’t want to use a local filesystem path. (if it’s meant to be a relative filesystem path, double-check whether it’s correct.)
Make sure you are using the right URL.