Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Construct URL
12-05-2012, 12:18 AM #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-05-2012, 12:44 AM #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/188.8.131.52/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/184.108.40.206/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.