Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7072815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:51:17+00:00 2026-05-28T05:51:17+00:00

I have a url on my page which has a dynamic element… <a class=TOPHEADING

  • 0

I have a url on my page which has a dynamic element…

<a class="TOPHEADING" href="/CRM/eware.dll/SessionFind?&Act=200&CLk=T&Key0=1&Key1=2" target="EWARE_MID">

Namely the key1 and key0 values I would like to prate the href with the following code…

var strPath = document.URL;
var arrayApp = strPath.split("&Act");
var strStartPath = arrayApp[0]+GetKeys()+"&Act=432"+"&dotnetdll=Customs&dotnetfunc=RunCompanySummary";
document.location.href= strStartPath;

the new link will be held in the strStartPath variable.

So essentially I need to replace the deployed href with that of the variable strStartPath on the load of the page.

Is this possible in JQuery and if so how?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:51:18+00:00Added an answer on May 28, 2026 at 5:51 am

    It “seems very complex”? It’s really easy , let’s break this code:

    function getParameterByName(name)
    {
      name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
      var regexS = "[\\?&]" + name + "=([^&#]*)";
      var regex = new RegExp(regexS);
      var results = regex.exec(window.location.href);
      if(results == null)
        return "";
      else
        return decodeURIComponent(results[1].replace(/\+/g, " "));
    }
    

    This function gets one parameter “name”.
    The first 2 lines are the regex expression, the third one defines a new regex object.
    The 4th line excute the regex exp. on the “window.location.hre” which is the URL of the current page , the condition checks if there’s a result of the expression in the current url or not.

    Basicly , for your needs:

    <a href="http:/www.bla.com/g.php?key0=11212&key1=2222&bla=wewe" id="link1">
    
    <script>
    var link = document.getElementById("link1");
    var url  = link.href;
    var keyZeroValue = getParametersByname("key0" , url);
    var keyOneValue = getParametersByname("key1" , url);
    
    function getParameterByName(name,url)
    {
    
      name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
      var regexS = "[\\?&]" + name + "=([^&#]*)";
      var regex = new RegExp(regexS);
      var results = regex.exec(url);
      if(results == null)
        return "";
      else
        return decodeURIComponent(results[1].replace(/\+/g, " "));
    }
    

    this should do the work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dynamic combo box which has the URL as the value. I
I have a page which has a series of dynamic jquery ui dialogs which
I Have a page which has comments left by users, each post has has
I have a php page which has a chart, a date picker(calendar) and a
I have a VF page which has 2 date fields and search button. On
Here is a problem I have encountered. I have jsp page which has a
I have a vanilla html page which has a form in it. A requirement
I have a parent page which has an iframe and also has javascript which
I have a page which has a style like this in a css file:
i shall state my problem here.. I have an index.html page which has a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.