boemboem
06-19-2009, 02:50 PM
I wonder if this is possible, the document.getElementById('MyLink').href I mean. At first sight it doesn't work, but maybe I did something wrong with the quotes or something.
Any help would be great :)
<script type="text/javascript">
function changeLink()
{
document.getElementById('MyLink').innerHTML="Bookmark me!";
document.getElementById('MyLink').href="javascript:document.write('<html><head><title>{$txt_short_url}</title></head><body><form name=\'urlform\' action=\'{$short_url}\' method=\'post\'><input type=\'hidden\' name=\'u\' value=\'' + window.location.href + '\' /></form></body></html>');document.forms[0].submit()";
document.getElementById('MyLink').target="_blank";
}
</script>
<body onload changeLink();>
<a id="MyLink" href="http://www.JustaLink.com">Just A Link</a>
Any help would be great :)
<script type="text/javascript">
function changeLink()
{
document.getElementById('MyLink').innerHTML="Bookmark me!";
document.getElementById('MyLink').href="javascript:document.write('<html><head><title>{$txt_short_url}</title></head><body><form name=\'urlform\' action=\'{$short_url}\' method=\'post\'><input type=\'hidden\' name=\'u\' value=\'' + window.location.href + '\' /></form></body></html>');document.forms[0].submit()";
document.getElementById('MyLink').target="_blank";
}
</script>
<body onload changeLink();>
<a id="MyLink" href="http://www.JustaLink.com">Just A Link</a>