PDA

View Full Version : Problem with script



jimk
04-10-2012, 02:06 PM
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.

ajfmrf
04-10-2012, 03:15 PM
Please post the problem pages url so people can see the "whole" thing so to speak.It will make it easier to help you.

traq
04-11-2012, 03:38 AM
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.

keyboard
04-11-2012, 05:21 AM
<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.