in

SharePoint Blogs

The Best Place for SharePoint-related Blogs

This Blog

Syndication

Becky's Blog

This is Becky Isserman's Blog about her Sharepoint blunders and successes. She is an Admin/Developer at Terracon Consulting Firm in the Kansas City Area.
This blog has been moved to http://www.mosslover.com.

Replace URL's on the Quicklaunch in Javascript

Here is some sample code: 

while(document.getElementById('zz2_QuickLaunchMenu'+i) != null)
                          { //&& i < divsArray.length){
                            var menu = document.getElementById('zz2_QuickLaunchMenu'+i);
                            var hyperlinks = menu.getElementsByTagName('a');  //looks for the hyperlink tags using the quicklaunch tag

                                hyperlinks[0].href = hyperlinks[0].href.replace(URL, URLToReplace);  //replaces the URL text
                                hyperlinks[0].target = "_blank";                            //allows for opening the link in a new window  
                       
                                   
                            i+=1;
                        }
This tag for the quicklaunch: zz2_QuickLaunchMenu you can find by right clicking on your list and looking for the quick launch menu.  It will probably include the name "QuickLaunchMenu" and some text in the same format as zz2_.  The code is pretty straightforward.  If you have any comments or questions let me know.  Have a very good weekend!

Comments

 

Links (2/7/2008) « Steve Pietrek’s SharePoint Stuff said:

Pingback from  Links (2/7/2008) &laquo; Steve Pietrek&#8217;s SharePoint Stuff

February 7, 2008 6:27 PM

Leave a Comment

(required )  
(optional )
(required )  
Add

About MOSSLover

I am a Sharepoint and .Net Consultant working for a company based in the Kansas City Metro Area. I have been working Sharepoint since July 2005. I love to play World of Warcraft and discuss all things Sharepoint.

Need SharePoint Training? Attend a SharePoint Bootcamp!

Posts (c) their respective authors. Everything else (c) 2007 SharePoint Experts