I’m looking for a java script that will allow me to send a link in a e-mail that when the link is clicked on, the link can get say the users id number out of the link.
@khalidali63Jan 18.2003 — #The code sgment below should take care of that for you <i> </i><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head> <title>Untitled</title> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <title>MAIL TO FORM!</title> <script> function emailVariableValue(){ var frm = document.forms; var subject = "This email is being sent using a function by variables" var body = document.getElementsByTagName('a')[0].href; frm[0].action = "MAILTO:[email protected]?subject="+subject+"&body="+body+";"; return true; } </script> </head> <body bgcolor="a1c3a1">
<form name="comments" method="POST" onsubmit="return emailVariableValue();" enctype="text/plain"> Thanks for taking some time to send me your views <a href="www.cnn.com">CNN</a> <input type="Submit" value="Submit"> <input type="RESET"></p> </form> </body> </html>
@pyroJan 18.2003 — #If I'm understanding you correctly, you want to parse the link to get the 777, correct? If so you can use split to split the location at the ? and then, resplit to split at the =. End result, 777. If this is what you are looking for, I can explain how to do this.
@pyroJan 18.2003 — #This will return 777 (or anything after the =) into the finallocation variable. Right now, I just alert it, so you can see that it works. If you have any questions, let me know.
<script type="text/javascript"> var location = document.location.href; var sublocation = location.split("?"); var newsublocation = sublocation[1].split("="); var finallocation = newsublocation[1]; alert (finallocation); </script>