Results 1 to 4 of 4

Thread: Problem with script

  1. #1
    Join Date
    Oct 2004
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Problem with script

    All,
    I am using the following script and it works fine except for the ?subject line. When I activate the script only the "I" shows up in the subject line of the email, what needs to be done to get the rest of the subject line to show up?
    [code]
    var name = "XXXX";
    var atsign = "@";
    var virtual_domain = "charter";
    var dotcom = ".net";
    var subject = "?subject=I want to receive email updates";
    document.write("<a href=mailto:", name + atsign + virtual_domain + dotcom + subject, ">Join our email list</a>");

    Hope this is clear to you.

    Jim K.

  2. #2
    Join Date
    Jan 2011
    Location
    Southeastern CT
    Posts
    612
    Thanks
    46
    Thanked 32 Times in 32 Posts

    Default

    Please post the problem pages url so people can see the "whole" thing so to speak.It will make it easier to help you.
    Thanks,

    Bud

  3. #3
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    don't know if this is what is causing your problem, but you might start by replacing the spaces in your value with something URL-friendly (like - or + ), or using the escape() function.

    Please post a link to the page on your site that contains the problematic script so we can check it out.

  4. #4
    Join Date
    Mar 2011
    Posts
    2,144
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Default

    Code:
    <script type="text/javascript">
    var name = "XXXX";
    var atsign = "@";
    var virtual_domain = "charter";
    var dotcom = ".net";
    var subject = "?subject=I%20want%20to%20receive%20email%20updates";
    document.write("<a href=mailto:", name + atsign + virtual_domain + dotcom + subject, ">Join our email list</a>");
    </script>
    Try that instead.

Bookmarks

Posting Permissions

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