Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I created Photo library now For add new item i have written Javascript code and which works fine in IE,Firefox but not in Chrome browser i get a error as"Uncaught TypeError: Object # has no method 'showModalDialog' ". I need to open a new item form on button click, in a Sharepoint 2010 page. here is the code and anyone fix the issue plz

<script type="text/javascript">
    function javascriptFunc()
{
var options = {  
              url:'/sites/sitename/_layouts/Upload.aspx?List={GUID}&RootFolder=',
              title: 'New Item',
              allowMaximize: false,
              showClose: true,
              autoSize:true,
dialogReturnValueCallback: function(dialogResult) 
        { 
          SP.UI.ModalDialog.RefreshPage(dialogResult) 
        }

};
              SP.UI.ModalDialog.showModalDialog(options); 

}
</script>
<div >
<a href="javascript:javascriptFunc();"><img url=""/></a>
</div>

Thanks in advance!

share|improve this question
    
Can you please show us the code you are using? –  Robert Lindgren Apr 29 '13 at 12:53
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.