West Wind Toolkit for .NET
modalDialog is not a function
Gravatar is a globally recognized avatar based on your email address. modalDialog is not a function
  Craig Tucker
  All
  May 22, 2020 @ 06:14am

Hi Rick, Can you tell me why I am receiving "modalDialog is not a function"?
Thanks, Craig

I am trying to get a simple test working first from an example before I customize. Something like this

function GenericButtonClick(item, name, e) {
                $.modalDialog("This dialog is generic, was created on the fly and requires no page elements. " + name,
            "Generic Modal Dialog ",
            ["OK", "Cancel", "Otherwise"],
            function () {
                var div = $("#divGenericButtonResult");
                var txt = $(this).val();
                if (txt == null)
                    return false; // don't exit

                div.text("You clicked on: " + txt).show();

                return true; // 
            }, false);
    }
Gravatar is a globally recognized avatar based on your email address. re: modalDialog is not a function
  Rick Strahl
  Craig Tucker
  May 22, 2020 @ 12:29pm

Make sure ww.jquery.js is loaded...

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: modalDialog is not a function
  Craig Tucker
  Rick Strahl
  May 22, 2020 @ 12:43pm

Yes, I know the method is in that js file, but am not sure why it isn't being picked up.
Does it have to be in a certain location or are there other associated js files that I'm missing? (I've tried both min and <script src="scripts/ww.jquery.js"></script>

Thank you, Craig

Gravatar is a globally recognized avatar based on your email address. re: modalDialog is not a function
  Rick Strahl
  Craig Tucker
  May 22, 2020 @ 01:41pm

Look in your JavaScript dev tools for errors. Pretty sure that path you have is not going to work - it needs to be a site relative path.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: modalDialog is not a function
  Craig Tucker
  Rick Strahl
  May 23, 2020 @ 05:21am

I can see in dev javascript tools the library path is resolved, however I'm still getting same error. Can you think of anything else to try? Thanks

Gravatar is a globally recognized avatar based on your email address. re: modalDialog is not a function
  Rick Strahl
  Craig Tucker
  May 24, 2020 @ 12:15am

Craig,

I don't know. The function should definitely be there. It's in ww.jquery.js. Maybe check and see if it's there and make sure that the library you're looking at is what's actually getting loaded.

I haven't looked at this stuff in years so other than a quick glance at the code where I see that $.modalDialog() definitely exists. You might also want to make sure that jquery is loaded and the $ is in scope. It should be...

+++ Rick ---

© 1996-2020