2

This is my Code, after popup dialog box open need to click the button the function given should work.

$(document).ready(function () {
            var box = $('#openbox').dialog({
                autoOpen: false,
                width: 100,
                height: 200,
                title: 'hi',
                modal: true
            });
            $('#open-box').click(function () {
                getbtn = $('#openbox').dialog({
                    buttons: {
                        "view": sayhi()
                    }
                });
                getbtn.dialog("open");
            });
            function sayhi() {
                alert("hi..");
            }
        });

But problem is while opening popup dialog box the function sayhi() is working. not showing any name in button and button click in popup box not working. how to do this?

3
  • may be call like "view":function(){sayhi();} ? Commented Oct 30, 2015 at 5:24
  • its working now thanks @NullPoiиteя Commented Oct 30, 2015 at 5:29
  • @NullPoiиteя sure its working and thanks for support i am waiting to click this as answer...!!! Commented Oct 30, 2015 at 6:25

1 Answer 1

1

You can not call function like that because

"view"://here you have  object which have method view 

To call that try

getbtn.button.view 

and to call directory just use this

"view": sayhi();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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.