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,060
  • 20
  • 106
  • 167
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
  • 610,884
  • 134
  • 1,288
  • 1,151