Results 1 to 4 of 4

Thread: Client side JavaScript to send webpage via e-mail

  1. #1

    Thread Starter
    KrisSiegel.com Kasracer's Avatar
    Join Date
    Jul 2003
    Location
    USA, Maryland
    Posts
    4,985

    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?

  2. #2
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196

    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

  3. #3
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196

    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.

  4. #4
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196

    Re: Client side JavaScript to send webpage via e-mail

    bugger more bugs problem with ampersands in the url

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width