Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 08-13-2009, 04:21 PM   PM User | #1
cskull
New to the CF scene

 
Join Date: Aug 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
cskull is an unknown quantity at this point
Post Javascript Dynamic Link

Looking for a way to pass the subsite portion of the address of the current page to produce a dynamic link. For example - if a user is on the page //dynamic/sub/default.aspx and clicks on a link on the page to go to a library in a different site such as //sharepoint.mysite.com/sites/subsite/FormLib/Forms/<insert dynamic portion here>.aspx, how do I automatically take the "sub" from the current address and place it in the filename of the address I want to go to such as this:
//sharepoint.mysite.com/sites/subsite/FormLib/Forms/sub.aspx

This is my first attempt but missing some things:

Code:
<script type="text/javascript">
function ExistingForms()
{
                var subsite="";
                subsite = window.top.location;
                subsite = subsite <not sure what to put here in order to store just the subsite name, no other portion of the address>
                
                var RequestLib = "http://sharepoint.mysite.com/sites/subsite/FormLib/Forms/";
                
                passlink(RequestLib+subsite+".aspx");
}
</script>
cskull is offline   Reply With Quote
Reply

Bookmarks

Tags
dynamic, javascript, link, sharepoint, subsite

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:58 AM.


Advertisement
Log in to turn off these ads.