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?
It “seems very complex”? It’s really easy , let’s break this code:
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:
this should do the work.