Client side JavaScript to send webpage via e-mail
Sometimes at work I need to send a web page to a co-worker. What I want to do is make a script that is client side (preferably in java script) so I can put it on my bookmark's toolbar and when I click on it, it automatically puts the URL in the body of the message and sets up the subject for the e-mail.
My problem is, I cannot get the string of the previous URL and if I try to use the current url, it wants to use the URL of my script.
Is it possible to do what I want and if so, how?
Re: Client side JavaScript to send webpage via e-mail
Both Firefox and IE have this feature already.
FireFox: Right click on page and select SendLink
IE: Toolbar has a mail Icon with a drop down list one of the options is Send a Link
Re: Client side JavaScript to send webpage via e-mail
Some quick messing produced this
Code:
javascript:parent.location.href= "mailto:" + prompt("Send Link To") +"?subject=Web Link&body="+location.href;
It works ok in firefox however in IE it's not so good. there is also a bug with cancelling the prompt, but this is just proof of concept.
Re: Client side JavaScript to send webpage via e-mail
bugger more bugs problem with ampersands in the url