Jump to content

value to hyperlink


jjmusicpro

Recommended Posts

<a href="/url/to/current/script.php?var=1" title="Value 1" onclick="return showHint(this.href);">Value 1</a>

 

with this javascript...

 


function showHint(val)
{
var urldata = val.slice(val.indexOf('?'));
var varvals = urldata.split('=');
alert('Value is ' + varvals[1]);
return false;
}

 

Now you could make this kind of javscript even less invasive by using javascript to add the onclick eventhandler- this is difficult in ie as you would have to faff about for hours simply because someone at Microsoft implemented their addevent fucntionality on a friday afternoon - they got to a point where it actually did something and said 'eureka! - time for the pub' they couldn't be bothered to check if it was useful or not....

Link to comment
https://forums.phpfreaks.com/topic/101229-value-to-hyperlink/#findComment-518015
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.