0
<html>
<head>
<script type="text/javascript">
function display(id)
{
  // open jquery modal window using jquery UI 
}

</script>

</head>
<body>
</body>
</html>

I want to open jquery modal window using jquery UI whenever the function display is called using normal javascript function call .

I can use .diolog function of jquery UI , but how to call it from within javascript function ?

Thanks

JasCav
  • 34,458
  • 20
  • 113
  • 170
Manan
  • 13
  • 2

1 Answers1

4

You can just use a selector and call .dialog(), like this:

function display(id)
{
  $("#"+id).dialog();
}

This uses the passed id for the #ID selector then just calls .dialog() for that element.

Nick Craver
  • 623,446
  • 136
  • 1,297
  • 1,155