2

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</div>
1
  • The code you've shown us looks fine. Can you reproduce the problem on jsbin.com or your own host? Commented Aug 8, 2010 at 2:10

2 Answers 2

2

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>
Sign up to request clarification or add additional context in comments.

3 Comments

it wont effect with or without <script type="text/javascript"> in there demo it worked without docs.jquery.com/UI/Dialog
I guarantee you it's your setup. Check out this sample jsfiddle.net/d6fAa
your correct the problem was the jquery was crashing with another js script i just had to move up the jquery to the top thanks
0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.