tags:

views:

129

answers:

1

I keep getting "dialogDiv.dialog is not a function".

I'm simply trying to invoke the jQueryUI dialog off my reference to the div.

So incoming is the divID, for example "myDiv". Then I set it to a variable and wrap it in $("#" + myDiv); so that now I have a reference to it in a nice clear variable. Then I try to invoke the dialog function and get that error.

not sure why and it's driving me nuts.

function showDialog(divID) 
{
    // Get reference to the div element
    var dialogDiv = $("#" + divID);
    alert("dialogDiv:" + dialogDiv);

    dialogDiv.dialog
    (
        {
            bgiframe: true,
            modal: true,
            autoOpen: false,
            show: 'blind'
        }
    )

    dialogDiv.dialog("open");
}
+2  A: 

Make sure that jQuery UI is, in fact, on the page. It's not packaged in normal jQuery.

Matchu
crap, I forgot to add the includes.
CoffeeAddict
@coffeeaddict: If adding those includes solved the problem, please be sure to click the check mark next to this question :) Thanks!
Matchu
That's what I was going for.
Matt Ball