Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I use the following code to pop up window but i am getting following error.
Uncaught TypeError: Object [object Object] has no method 'dialog'

Please help me regarding the same.
JavaScript
$(document).ready(function () {
            alert("hi");
            debugger;
            $(".openDialog").on("click", function (e) {
                alert("BBH");
                e.preventDefault();

                $("<div></div>").addClass("dialog").attr("id", $(this).attr("data-dialog-id")).appendTo("body").dialog({
                        title: $(this).attr("data-dialog-title"),
                        close: function () { $(this).remove(); },
                        modal: true,
                        width: 600,
                        left: 0,
                    })
                .load(this.href);
            });



            $(".close").on("click", function (e) {
                e.preventDefault();
                $(this).closest(".dialog").dialog("close");
            });
        })

View:
C#
@Html.ActionLink("Register here", "RegisterUser", "login", null, new { @class = "openDialog", data_dialog_id = "aboutdialog", data_dialog_title = "register new user" })
Posted
Updated 29-Dec-14 23:37pm
v2
Comments
Kornfeld Eliyahu Peter 30-Dec-14 5:38am    
You probably missing the jQuery UI libraries - dialog is part of it...

1 solution

please add jquery UI file in your solution, dialog definition available on that file.
 
Share this answer
 
Comments
Basheer Belgod 30-Dec-14 6:29am    
Ya even i enter the UI file to my solution then also i am getting same error.

<script src="~/Scripts/jquery-ui-1.8.24.js"></script>
<script src="~/Scripts/jquery-ui-1.8.24.min.js"></script>

Same Error i am getting
Uncaught TypeError: Object [object Object] has no method 'dialog'
abhishek_singh 31-Dec-14 1:12am    
I suppose there are some incompatibilities between the versions of jquery and jquery UI you are using.
So can you add latest reference for jquery and jquery UI.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900