Thursday, August 26, 2010

Open a SharePoint Best Bet in a New Window

I had a request to code a SharePoint best bet to open in a new window. After a bit of tinkering, I came up with the following code:


javascript:window.open('http://www.google.com');'<script language=\'JavaScript\'>history.go(-1)</script>';


I have only tested this in MOSS 2007 and it seems to work in IE/Mozilla just fine. The 'history.go(-1)' call is there due to a strange artifact with JavaScript in the best bet URL. Without it, you'll get taken to a blank screen after the new window opens.

No comments: