2

On my page, I am loading some HTML (via AJAX) into a div. The new HTML contains my $('.modal') jQuery UI Dialog. Once the HTML is loaded, FireBug gives me an error message for each modal in my HTML saying:

$(".modal").dialog is not a function
    height: 'auto'

The weird thing is that it's working. When I click the element that triggers the modal to appear, it appears! What should I do to prevent these messages from showing?

1
  • restart firefox, does it still happen, what about ie / chrome? Remember firebug is buggy - always restart firefox & check the other browsers if it seems odd Commented Sep 28, 2010 at 23:43

4 Answers 4

3

put this in your document

<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
Sign up to request clarification or add additional context in comments.

2 Comments

How do you know OP has not already added these files to his document?
if those libraries are included, I believe that OP is enough intelligent to not include them again.
2

Make sure you load jquery before jquery-ui in your application.

Comments

0

You probably have to call $(".modal").dialog after the ajax has finished loading

Comments

-1

hmm

var dialog = $(".modal").dialog({ autoOpen: false });


$("#click").click( function(e) {
   e.preventDefault();
   dialog.dialog("open");
});

this one works for me fine !

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.