JS function for constructing URL

Discussion in 'JavaScript' started by jj0914, Nov 1, 2007.

  1. #1
    Hi gang

    I am using Template toolkit and JS to construct a URL that I will be using in my app. here is what I am trying to do:

    the URL will look like this: www.example.com/activity/4/update/subject/2

    the '4' and '2' will be the arguments which I will pass in the JS function.

    can anyone give me some ideas how to create this function.

    Thanks in advance.
     
    jj0914, Nov 1, 2007 IP
  2. Jamie18

    Jamie18 Peon

    Messages:
    201
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    function make_url(num1,num2)
    {
    	var theURL = "www.example.com/activity/"+num1+"/update/subject/"+num2
    }
    Code (markup):
     
    Jamie18, Nov 2, 2007 IP