Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Need to get the parameter from URl to build href.

Need to get the parameter from URl to build href.

Scheduled Pinned Locked Moved Web Development
javascripthtmlcsssysadmintools
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 10491794
    wrote on last edited by
    #1

    I need to get the userId from URL and then build the href dynamically. For example in the URL the userId is Tom then I want to build the href as

    ../settings/userIdSetting.htm?userId=Tom
    and assign it to User Account
    Is this possible.
    Thanks in Advance,
    Kim

    <!DOCTYPE html>
    <meta charset="utf-8">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Sortable Table</title>
    <script language="javascript" type="text/javascript" src="../js/common.js"></script>
    <script language="javascript" type="text/javascript" src="../js/jquery-1.9.1.min.js"></script>
    <script language="javascript" type="text/javascript" src="../javascript/d3.v3.min.js"></script>
    <script language="javascript" type="text/javascript" src="../js/shCore.js"></script>
    <script language="javascript" type="text/javascript" src="../js/shBrushJScript.js"></script>
    <link type="text/css" href="../css/shCoreDefault.css" rel="stylesheet" />

    </head>
    <script>
    <pre lang="xml">// get the userId from URL
    var userId = getUrlVar('userId');

    function putUserId() {
    
        document.getElementById(&quot;userSettingId&quot;).innerHTML = &quot;../settings/userIdSetting.htm?userId=&quot; + userId ;
    }
    

    </script>
    <body onLoad = putTenantId()>
    <h2>Server Settings</h2>
    <!-- Need to get the userId from URL -->
    <a id= "userSettingId" href="../settings/userIdSetting.htm?userId=Tom">User Account </a>
    <br/>

    <br>
    <hr>
    </body>
    </html></pre>

    I 1 Reply Last reply
    0
    • U User 10491794

      I need to get the userId from URL and then build the href dynamically. For example in the URL the userId is Tom then I want to build the href as

      ../settings/userIdSetting.htm?userId=Tom
      and assign it to User Account
      Is this possible.
      Thanks in Advance,
      Kim

      <!DOCTYPE html>
      <meta charset="utf-8">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
      <title>Sortable Table</title>
      <script language="javascript" type="text/javascript" src="../js/common.js"></script>
      <script language="javascript" type="text/javascript" src="../js/jquery-1.9.1.min.js"></script>
      <script language="javascript" type="text/javascript" src="../javascript/d3.v3.min.js"></script>
      <script language="javascript" type="text/javascript" src="../js/shCore.js"></script>
      <script language="javascript" type="text/javascript" src="../js/shBrushJScript.js"></script>
      <link type="text/css" href="../css/shCoreDefault.css" rel="stylesheet" />

      </head>
      <script>
      <pre lang="xml">// get the userId from URL
      var userId = getUrlVar('userId');

      function putUserId() {
      
          document.getElementById(&quot;userSettingId&quot;).innerHTML = &quot;../settings/userIdSetting.htm?userId=&quot; + userId ;
      }
      

      </script>
      <body onLoad = putTenantId()>
      <h2>Server Settings</h2>
      <!-- Need to get the userId from URL -->
      <a id= "userSettingId" href="../settings/userIdSetting.htm?userId=Tom">User Account </a>
      <br/>

      <br>
      <hr>
      </body>
      </html></pre>

      I Offline
      I Offline
      Izu Great
      wrote on last edited by
      #2

      would want it in PHP? if yes:

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups