rainhider
rainhider

Reputation: 49

jquery dialog box never pops up at all

so here is the code (I have tried many variations of this (with the div, without the div) and jquery itself is working, but not the dialog box) I can do an alert box, but if I put a dialog in, it never works. No popup, nothing. A basic dialog box does not work.

$('#link).click(function(){
  $('#dialog).dialog();
  }

 <div id="dialog" title="Dialog Title" style="display:none"> Some text</div> 

Upvotes: 0

Views: 106

Answers (2)

rainhider
rainhider

Reputation: 49

Ok. So I figured out that in order to use the dialog box I had to include the jquery-ui declaration at the top of the page instead of just the jquery declaration.

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js" ></script>

Upvotes: 0

Mathew Thompson
Mathew Thompson

Reputation: 56429

You missed a quote after the #dialog selector and the #link selector, try this:

$('#link').click(function(){
    $('#dialog').dialog();
}

Upvotes: 2

Related Questions