-1
<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.6k21 gold badges117 silver badges175 bronze badges
asked Sep 25, 2010 at 16:35
2
  • 2
    Note that jQuery is Javascript. What you can do with Javascript, you can do with jQuery. Commented Sep 25, 2010 at 16:37
  • And to be more precise: jQuery is a JavaScript framework. Commented Sep 25, 2010 at 16:47

1 Answer 1

3

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.

answered Sep 25, 2010 at 16:36
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.