Connecting Tech Pros Worldwide Help | Site Map

Show Stopper

  #1  
Old July 23rd, 2005, 12:22 PM
Pat
Guest
 
Posts: n/a
The contents of a simple form are sent to a Perl CGI in the server.
The Perl code is:
use CGI qw(:standard);
print "Content-type: text/html\n\n";
print "<html><head></head><body>Testing Thruput<br>";

print "<script language="JavaScript">";
print "</script>";

$value = param(myname);
print "$value<br>";
$value = param(addr);
print "$value<br>";
print "</body></html>";

If <script language="JavaScript"> and the matching </script> tag are
output to the browser, it will not process -- the browser hangs. If
these two lines are commented out, the browser handles the page
without a problem.

Question: Cannot a CGI output an HTML page that includes JavaScript?

I'm either missing something basic, or making a dumb mistake.

Pat
  #2  
Old July 23rd, 2005, 12:22 PM
Andrew Thompson
Guest
 
Posts: n/a

re: Show Stopper


On 3 Jun 2004 10:53:32 -0700, Pat wrote:
[color=blue]
> print "<script language="JavaScript">";[/color]

try..
print "<script type='text/javascript'>";

N.B. use of single quotes..

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
  #3  
Old July 23rd, 2005, 12:22 PM
Ivan Marsh
Guest
 
Posts: n/a

re: Show Stopper


You have a quoting problem.

Try:

print "<script language='JavaScript'>";
print "</script>";

or:

print "<script language=\"JavaScript\">";
print "</script>";


--
i.m.
The USA Patriot Act is the most unpatriotic act in American history.

  #4  
Old July 23rd, 2005, 12:22 PM
David Dorward
Guest
 
Posts: n/a

re: Show Stopper


Pat wrote:
[color=blue]
> print "<script language="JavaScript">";[/color]
^
Quote marks!

And, since 1996, the language attribute has been deprecated and the type
attribute required.

print qq(<script type="text/javascript">);

or

print "<script type=\"text/javascript\">";


--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
  #5  
Old July 23rd, 2005, 12:22 PM
Lee
Guest
 
Posts: n/a

re: Show Stopper


Pat said:[color=blue]
>
>Question: Cannot a CGI output an HTML page that includes JavaScript?[/color]

For future reference, that would have made a much better
subject line than "Show Stopper".

  #6  
Old July 23rd, 2005, 12:23 PM
Mick White
Guest
 
Posts: n/a

re: Show Stopper


Ivan Marsh wrote:
[color=blue]
> You have a quoting problem.
>
> Try:
>
> print "<script language='JavaScript'>";
> print "</script>";
>
> or:
>
> print "<script language=\"JavaScript\">";
>
>
>[/color]
Or
print "<\/script>";
Mick
  #7  
Old July 23rd, 2005, 12:23 PM
Lee
Guest
 
Posts: n/a

re: Show Stopper


Mick White said:[color=blue]
>
>Ivan Marsh wrote:
>[color=green]
>> You have a quoting problem.
>>
>> Try:
>>
>> print "<script language='JavaScript'>";
>> print "</script>";
>>
>> or:
>>
>> print "<script language=\"JavaScript\">";
>>
>>
>>[/color]
>Or
>print "<\/script>";[/color]

No need for that, since Perl doesn't find anything magical about "</".

That's only necessary if the code that's doing the writing is within
an XHTML page.

  #8  
Old July 23rd, 2005, 12:23 PM
Pat
Guest
 
Posts: n/a

re: Show Stopper


Lee <REM0VElbspamtrap@cox.net> wrote in message news:<c9nq9a024n@drn.newsguy.com>...[color=blue]
> Pat said:[color=green]
> >
> >Question: Cannot a CGI output an HTML page that includes JavaScript?[/color]
>
> For future reference, that would have made a much better
> subject line than "Show Stopper".[/color]


Thanks to all of you for pointing out this basic error on my part. I
discovered it after I'd posted the message, and feel like a beginner
(which I am)!

And roger on a better subject line for my original message. I'll have
to think more about the subject, and not my feelings of the moment.

Thanks, all
Pat
  #9  
Old July 23rd, 2005, 12:23 PM
Mabden
Guest
 
Posts: n/a

re: Show Stopper


"Pat" <pmcclure33@yahoo.com> wrote in message
news:fdda218c.0406031620.20327f60@posting.google.c om...[color=blue]
> Lee <REM0VElbspamtrap@cox.net> wrote in message[/color]
news:<c9nq9a024n@drn.newsguy.com>...[color=blue][color=green]
> > Pat said:[color=darkred]
> > >
> > >Question: Cannot a CGI output an HTML page that includes JavaScript?[/color]
> >
> > For future reference, that would have made a much better
> > subject line than "Show Stopper".[/color]
>
>
> Thanks to all of you for pointing out this basic error on my part. I
> discovered it after I'd posted the message, and feel like a beginner
> (which I am)!
>
> And roger on a better subject line for my original message. I'll have
> to think more about the subject, and not my feelings of the moment.
>[/color]


I just thought that this concept should not be buried in a thread, so I made
it the subject line. Not only newbies, either!

--
Mabden


Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating a Popup Stopper program Sam Learner answers 4 November 21st, 2005 04:09 AM
Show stopper problem!! Parser Error Message: Execute permission cannot be acquired David Berman answers 0 November 18th, 2005 01:51 PM
repeat something in a thread, but stop when the program stops Harald Armin Massa answers 9 July 18th, 2005 05:01 PM