I have form input whose underlying perl script spits out another custom form, including some javascript, but the output inserts "48 48" at various places throughout the javaScript. Any idea why? (Please bear with any inefficiencies here. My technical computing experience is brief).
Relevant perl code:
Code:
print $getBrush->header();
my $thisStartHTML=$getBrush->start_html("Post Expression");
$thisStartHTML=~s/<\/head>/<style type="text\/css">\n#covenant \{\n\nposition:relative;\ntext-align:center;\nfont-style:italic;\nfont-weight:bold;\nfont-size:15px;\ncolor:burlywood\n\t}\n\n<\/style>\n<\/head>/s;
print $thisStartHTML;
print qq{
Followed by a rather lengthy string of html code, with the following inserted somewhere in the midst:
Code:
<div id="covenant">\n\nI will speak what is noble, not base.\n\n</div>\n\n<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>\n\n<script>\n\t$(function () \{\n\t\tvar switchPledge = function () \{\n\t\t\tvar pledge = $(this).text();\n\t\t\tif (pledge === 'I will speak what is noble, not base.') \n\{\n\t\t\t$(this).text('I will build up, and not tear down.');\n\t\t\}\n\n\t\t\telse if (pledge === 'I will build up, and not tear down.')\n\t\t\t\t\{\n\t\t\t\t$(this).text('I will be kind, and not destroy.');\n\t\t\t\t\}\n\t\t\t\telse \{$(this).text('I will speak what is noble, not base.');\n\t\t\t\t\}$(this).show();\n\t\t\t\t$(this).fadeOut(2000, switchPledge);\n\t\t\t\};\n\n\t\t$('#covenant').fadeOut(2000, switchPledge);\n\t\});\n</script>
Followed by some more html, and followed again by:
Code:
};
print $getBrush->end_html();
Here's what it puts out in the javaScript section:
Code:
<script>
48 48function () {
var switchPledge = function () {
var pledge = 48 48this).text();
if (pledge === '"I will speak what is noble, not base."')
{
48 48this).text('"I will build up, and not tear down."');
}
else if (pledge === '"I will build up, and not tear down."')
{
48 48this).text('"I will be kind, and not destroy."');
}
else {48 48this).text('I will speak what is noble, not base.');
}48 48this).show();
48 48this).fadeOut(2000, switchPledge);
};
48 48'#covenant').fadeOut(2000, switchPledge);
});
</script>
Why all the 48s?