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/18.104.22.168/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/22.214.171.124/frameset.html'; return true;"> Order Entry </a>
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.