every time i try using jquery dialog i get error null when debugging using firebug, here is the code
<script type="text/javascript" src="js/jquery-1.4.2.js"></script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"></script>
<script>
$(document).ready(function() {
$("#dialog").dialog();
});
</script>
<div id="dialog" title="Dialog Title">I'm in a dialog&开发者_如何学运维lt;/div>
It could be that your jQuery.js file doesn't exist in that path. Replace it with the Google hosted one.
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
Also you should add <script type="text/javascript"></script>
where your jQuery code is.
<script type="text/javascript" src="js/jquery-1.4.2.js"></script>
<link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/base/jquery-ui.css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#dialog").dialog();
});
</script>
<div id="dialog" title="Dialog Title">I'm in a dialog</div>
Your <link>
element isn't closed. I'm guessing that it's somehow picking up and squashing the dialog div, as anything in a link tag I would presume is ignored and not placed on the DOM.
精彩评论