Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi there,

Consider the following code:

XML
function ShowWelcomeDialog() {
        var data = {};
        
        var options = {
            url: "/_layouts/xxxx/xxxxxss.aspx",
            title: "xxx xxx",
            width: 700,
            height: 950,
            dialogReturnValueCallback: myDialogCallback,
            args: JSON.stringify(data)
        };
        
        SP.UI.ModalDialog.showModalDialog(options);
        return false;
    }


i have this code for a button click and the modal opens fine in firefox and ie. But it doesn't open in Chrome. gives the following error in console:
Uncaught TypeError:Object #<Object> has no method 'showModalDialog'..

Can anybody help me on this...
Thanks in advance..
Posted

You page that trigger the invocation of your Javascript method showModalDialog did not included the reference to .JS file that contains your Javascript. So you have to check that page and to include a reference to your .JS file.
 
Share this answer
 
Comments
Vikas Kottari 27-Mar-14 3:37am    
That page ia a webpart and its masterPage has reference to all js files. If not how would it work in IE and Firefox????
Raul Iloc 27-Mar-14 3:43am    
This error is typical for trying to access a Javascript that was not referenced in the page of invocation. Did you clear your Chrome browser cache?
Vikas Kottari 27-Mar-14 4:10am    
Sometimes it would work after clearing the cache. But fails most of the times.
 
Share this answer
 

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