SharePoint 2010: JavaScript in Quick Launch and Top Link Bar!

The quick way to get a Quick Launch to open in a new windows is like this! The Gotcha is NOT to use double quotes! Always use single quotes.

javascript:window.open('http://www.bbc.co.uk','_blank');history.go(0);
Good link here too: http://techtrainingnotes.blogspot.ca/2010/10/sharepoint-javascript-in-quick-launch.html

To Open a SharePoint 2010 window as a Dialog such as NewForm.aspx, use this method.

EXAMPLE CODE:
JavaScript:var options=SP.UI.$create_DialogOptions();
options.url='http://techtrainingnotes.blogspot.com';
options.height = 400;
void(SP.UI.ModalDialog.showModalDialog(options))

Put this in one line in the Quick Launch, like this;

JavaScript:var options=SP.UI.$create_DialogOptions();options.url='/intranet/Lists/Issues/NewForm.aspx';void(SP.UI.ModalDialog.showModalDialog(options))


as explained here: http://techtrainingnotes.blogspot.ca/2010/12/sharepoint-opening-2010-dialog-box-from.html

 

Comments are closed