Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    May 2009
    Posts
    48
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Javascript Formatting

    I can't figure out how to properly format the code below. I am looking to add breaks after where it says below. Also to change the color if possible.

    Any help would be much appreciated.


    function isPPC() {
    if (navigator.appVersion.indexOf("PPC") != -1) return true;
    else return false;
    }
    if(isPPC()) {
    document.write('<b>Send <A CLASS="contact" HREF=\"mailto:\?subject\=ADD A BREAK AFTER THIS ' + document.title + '?body= ADD A BREAK AFTER THIS ' + '\" onMouseOver="window.status=\'Send your friends e-mail about this page\'; return true" TITLE="Send your friends e-mail about this page">this page<\/A> to a friend</b>');
    }
    else { document.write('<b>Send <A CLASS="contact" HREF=\"mailto:\?body\=ADD A BREAK AFTER THIS ' + document.title + ' ADD A BREAK AFTER THIS ' + '\" onMouseOver="window.status=\'Send your friends e-mail about this page\'; return true" TITLE="Send your friends e-mail about this page">this page<\/A> to a friend</b>');
    }

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    29,550
    Thanks
    89
    Thanked 4,935 Times in 4,896 Posts
    Using mailto: is really *not* a good idea. First of all, it only works if the user has a link to his mail client set up from the browser. Some browsers don't support it and in any case nobody using web-based email will be able to use it. Secondly, it means that the user must approve the mail send before it happens, and many people are suspicious of approving anything like that and will click "No."

    MUCH better is to use server-based mail senders. PHP or ASP or JSP or CGI. Most ISP's include a "form mailer" just for this purpose: You just create a <form> and specify that the action= is the PHP/ASP/CGI form mailer and presto, it works.

    You really should check with your ISP to see if they offer one.

    Also, if the form mailer supports it, you may be able to use HTML in your email, so you could then use colors, etc.
    Be yourself. No one else is as qualified.

  • Users who have thanked Old Pedant for this post:

    Wayniac (11-16-2009)

  • #3
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,610
    Thanks
    11
    Thanked 619 Times in 599 Posts
    Quote Originally Posted by Old Pedant View Post
    Using mailto: is really *not* a good idea. First of all, it only works if the user has a link to his mail client set up from the browser. Some browsers don't support it and in any case nobody using web-based email will be able to use it. .
    not true anymore; check into custom protocols
    Create, Share, and Debug HTML pages and snippets with a cool new web app I helped create: pagedemos.com

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    29,550
    Thanks
    89
    Thanked 4,935 Times in 4,896 Posts
    Ummm...and what about MSIE and Safari users??

    When I use MSIE on my machine, just for example, mailto: does *NOT* work.
    Be yourself. No one else is as qualified.

  • #5
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,610
    Thanks
    11
    Thanked 619 Times in 599 Posts
    Quote Originally Posted by Old Pedant View Post
    Ummm...and what about MSIE and Safari users??

    When I use MSIE on my machine, just for example, mailto: does *NOT* work.
    sorry bout that, was referring specifically to:
    Quote Originally Posted by Old Pedant View Post
    nobody using web-based email will be able to use it.
    that said, its an HTML5 thing, so i'll bet "the other" browsers catch up soon...
    Create, Share, and Debug HTML pages and snippets with a cool new web app I helped create: pagedemos.com

  • #6
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    29,550
    Thanks
    89
    Thanked 4,935 Times in 4,896 Posts
    Yeah, I think it's about time for this protocol stuff. HOWEVER...

    However, it still means you have to have *something* on the server to handle the submittal, and so it seems to me that using one of the more or less standard form mailers for PHP/ASP/JSP/CGI and just changing the action= of the <form> does exactly the same thing and requires essentially the same backend processing, so why not use that and have it compatible with all browsers right now, instantly.
    Be yourself. No one else is as qualified.

  • #7
    New Coder
    Join Date
    May 2009
    Posts
    48
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thank you all for your help!


  •  

    Posting Permissions

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