Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Construct URL
12-04-2012, 11:18 PM #1
- Join Date
- Dec 2012
- Thanked 0 Times in 0 Posts
I have a more than 1000 URL'S like:
where only the foldername changes in the URL.
Now I need a functionality on my page where there are links which has the name same as the folder name and on clicking it , it automatically replaces the name with the foldername and generates and opens the url for me.
Suppose there is link with name : OrderEntry . So on clicking it the following URL should be generated:
and opened in the browser. Any kind of help would be appriciated.
Thanks in advance .
12-04-2012, 11:44 PM #2
And so why not simply use
Presumbably, you are generating these links with some server-side code (PHP/ASP/JSP/etc.). No? So let the server side code do it.Code:<a href="localhost/OrderEntry/trainer/22.214.171.124/frameset.html ">Order Entry</a>
The call to replace there will remove all characters except letters, digits, and underlines from the text between the <a> and </a> tags.Code:<a onclick="this.href='localhost/' + this.innerHTML.replace(/\W/g,"") + '/trainer/126.96.36.199/frameset.html'; return true;"> Order Entry </a>
Be yourself. No one else is as qualified.