I have an tag as follows:
<a onClick="showDialog();">
<?php Print $s; ?>
</a>
In my document.ready()
function, i have the showDialog()
function
function showDialog()
{
$('#userdata').dialog('open');
}
And i make the dialog not to appear, by including this in my document.ready() function
$("#userdata").dialog({autoOpen:false});
Also, in my body section, i have the "userdata" div element
<div id="userdata">hello</div>
But,when i click on the link, nothing happens.... But if i add an alert()
inside the showDialog()
function, it is getting triggered. can someone tell me how to display t开发者_开发问答he jquery dialog box ?
thanks
When a link is clicked it will open content in dialog box.
var p = '<p>test test test test test test</p>';
$('a').click(function(){
$(p).dialog({
...
});
Check working example at http://jsfiddle.net/msKZt/2/
on your click event of the link add this
$('#ElementID').dialog('open');
精彩评论