LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-27-2011, 02:53 PM   #1
bluegospel
Member
 
Registered: Jan 2010
Distribution: centOS
Posts: 404

Rep: Reputation: 53
Perl-generated page inserts "48 48" throughout javascript


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?
 
Old 06-27-2011, 06:06 PM   #2
bluegospel
Member
 
Registered: Jan 2010
Distribution: centOS
Posts: 404

Original Poster
Rep: Reputation: 53
Red face

Sorry. Next time, I'll step back an hour or 2 if I've got too much going on in my head to figure something easy like this out. Patience, that's what I need.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Perl: how to save an e-mail attachment on disk keeping the "&" character (no "%26"!!) d1s4st3r Programming 5 09-29-2010 09:30 PM
"Failed Dependency error" while installing RPM for "DateTime" perl modules giridhargopal.cj Linux - Newbie 7 11-19-2008 12:05 AM
Suggestion: for "subscribed threads" & "top of page" buttons Old_Fogie LQ Suggestions & Feedback 7 07-10-2006 05:10 PM
javascript merge "if confirm" with "submit" rblampain Linux - Software 6 09-18-2005 10:44 AM
problem "make"ing gtk+ "/usr/bin/env: perl -w" caid Linux - Newbie 8 07-29-2005 04:51 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration