2

I have the following problems with showing javascript pop up page

  • I have added a content editor web part inside my team site, then I insert an embedded code snippet with the following code:- <a href="javascript:OpenPopUpPage('/sites/Intranet/SitePages/AboutIntranet.aspx');">About this</a> My idea was to open a popup window showing the associated site page. But this did not work, and an empty dialog box was show. While if I write the following snippet to refer to bing.com it will work well :- <a href="javascript:OpenPopUpPage('www.bing.com');">About this</a>

So any idea about this ?

  • Second problem, When the popup windows was shown for bing.com users will not be able to expand the java script pop up window , they can only use the tool bar to view the window details. So any idea how to make the java script pop up expandable?

  • Third problem. Is there a way to add a pop-up to a quick lunch links? Because if I write <a href= …..> Inside the web URL for a quick lunch link, I will get an error mentioning that the URL must start with http? Thanks a lot for any help.

Regards

3

John,

The OpenPopUpPage() method takes multiple arguments and from what I have found scrubbing the internet, you must include the callback method when using it so that you do not get a blank dialog (even if it means just passing null). Try the following:

OpenPopUpPage('/sites/Intranet/SitePages/AboutIntranet.aspx', RefreshPage);

Reference MSDN Page

0

I think this would get you what you want:

function OpenDialog(strPageURL) 
{
    var dialogOptions = SP.UI.$create_DialogOptions();
    dialogOptions.url = strPageURL;
    dialogOptions.title = 'Welcome to SharePoint';
    dialogOptions.allowMaximize= true;
    dialogOptions.width = 750;
    dialogOptions.height = 500;
    /* CloseCallback will get called when the Dialog is closed */
    dialogOptions.dialogReturnValueCallback = Function.createDelegate(null, CloseCallback);  
    SP.UI.ModalDialog.showModalDialog(dialogOptions); // Open the Dialog
    return false;
}

Source: http://sharethepunto.blogspot.de/2014/06/how-to-create-pop-up-dialog.html

I haven't had the problem where you get an empty Dialog box with OpenPopUpPage();

-1

Take the reference of this site.

http://javascript.about.com/library/blmodal.htm

  • the link does not answer my questions, can you advice please ? – john Gu Aug 29 '13 at 13:36
  • Could you try once with full absolute url of your site. – Pushpendra Aug 29 '13 at 17:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.