Geeks With Blogs

News
About Me:
I am a Female SharePoint Developer (a platinum unicorn). I have been working with SharePoint since I attended the Portal University in 2005. I hold a BA in Computer Science from the University of Missouri - Kansas City. I love playing Rockband, organizing user group meetings, working with code, attending events as a speaker or organizer, and having bizarre conversations about geek things with cool people. If you have any comments or questions fill out the contact form and I will try my best to help.



Post Categories

The Guide of a MOSSLover Becky Isserman's Blog

Here is some sample code:

while(document.getElementById('zz2_QuickLaunchMenu'+i) != null) 
{  
               var menu = document.getElementById('zz2_QuickLaunchMenu'+i); 
              //looks for the hyperlink tags using the quicklaunch tag 
               var hyperlinks = menu.getElementsByTagName('a');  
               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!

Re-posted from old blog.

Technorati Tags: ,,
Posted on Friday, February 22, 2008 5:00 PM MOSS , Javascript | Back to top


Comments on this post: Replace URL's on the Quicklaunch in Javascript

# re: Replace URL's on the Quicklaunch in Javascript
Requesting Gravatar...
Does this need to go into a content editor webpart on the page?
Left by Rob (Maidstone) on Aug 07, 2008 5:13 AM

# re: Replace URL's on the Quicklaunch in Javascript
Requesting Gravatar...
You could put it in a web part or embed it in the page or add it to a content editor web part. It's really one of those pick your poison type of things.
Left by MOSSLover on Aug 08, 2008 5:07 PM

# re: Replace URL's on the Quicklaunch in Javascript
Requesting Gravatar...
Can it be done at run time , i want thing to be done during pacakage and deployment of a sharepoint site.

please comment ....
Left by Arun on Dec 24, 2008 5:03 AM

# re: Replace URL's on the Quicklaunch in Javascript
Requesting Gravatar...
Hi

i think if we using this above javascript code to update on page,but not updating in actual source(from share point db).In each every time this script needs to be execute on page loading.

i need help to update the url only once to be exected ....


Please help me to come out with solutions.
Left by Suresh on Dec 25, 2008 10:50 PM

# re: Replace URL's on the Quicklaunch in Javascript
Requesting Gravatar...
Arun - you want to do this at the Page Load Event. Override the Page Load event in Javascript as seen at this link: http://blogit.create.pt/blogs/andrevala/archive/2007/12/16/WSS-Tip-_2300_19_3A00_-Using-JavaScript-in-Body-OnLoad-Event.aspx.
Suresh - You should add the Javascript code to a master page. That will allow you to use this code in multiple pages.
Left by MOSSLover on Dec 25, 2008 10:58 PM

# re: Replace URL's on the Quicklaunch in Javascript
Requesting Gravatar...
Thanks for info.
Left by Keno in rete on May 19, 2010 12:58 AM

# re: Replace URL's on the Quicklaunch in Javascript
Requesting Gravatar...
i like it very much thank you !
Left by flying on Jun 18, 2010 11:36 AM

Your comment:
 (will show your gravatar)


Copyright © MOSSLover | Powered by: GeeksWithBlogs.net