I didn't properly close the layer tag :)
<layer id="help_layer"
visibility="visible"
onBlur="this.visibility='hidden';"
left="100"
top="100"
height="200"
width="200"
src =
"http://hr-iguana.tcpl.ca:82/survey-cgi/employee_survey/test_help.pl"
</layer>
See, theres no '>' to close the starting layer tag :)
Now eveything works fine ;)
Just shoot me now !
Thanks,
Carey
Carey bingham wrote:
> Please help :)
>
> I am trying to get a layer to dynamically refresh with the contents of a
> perl CGI script. When the following page loads initially, it displays
> the layer with the contents of the CGI call properly(it is pointed to
> the CGI via the SRC attribute of the layer when it is created). When I
> click on the "CLICK" link, it should toggle the SRC of the layer
> help_layer and display the new contents again.
>
> All it ever does when using the CLICK link is refresh the layer with
> blank !! This is very frustrating !!
>
> Below is all the source for HTML web page, Javascript function newHelp
> and the Perl Scrpt test_help.pl(test_help2.pl is the exact same script).
>
> Note that I did try using two different actual web pages here and the
> results are the same. It display the web page in the layer properly on
> the load but when trying to display a new web page in the layer
> dynamicaly via the newHelp function, it just comes back blank !!
>
> Also note that the PERL script function properly also when called by it
> self and the first time it is called by the HTML page when the browser
> initially loads the layer.
>
> Thanks,
>
> Carey
>
> ################
> Test HTML Page :
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
>
> <html>
> <head>
> <title>Untitled</title>
>
> <script language="JavaScript1.2"
> src="../common/ess_customprocessing.js"></script>
>
> </head>
>
> <body>
>
> <form name=form>
>
> <input type = "text" name = "field" value = "" width = "45">
> <a href="#" onCLick = " document.help_layer.top=event.layerY+200;
> document.help_layer.left=event.layerX;
> newHelp(event);
> document.help_layer.visibility='visible';
> return false;
> ">
> CLICK
>
> </a>
>
> </form>
>
> <layer id="help_layer"
> visibility="visible"
> onBlur="this.visibility='hidden';"
> left="100"
> top="100"
> height="200"
> width="200"
> src =
> "http://hr-iguana.tcpl.ca:82/survey-cgi/employee_survey/test_help.pl"
> </layer>
>
> </body>
> </html>
>
> ####################
>
> Heres the Javascript file :
>
> function newHelp(event){
> if(document.help_layer.src ==
> 'http://hr-iguana.tcpl.ca:82/survey-cgi/employee_survey/test_help.pl'){
> alert(eval(document.forms[0].field.value));
> document.help_layer.src = eval(document.forms[0].field.value);
> }else{
>
> alert('http://hr-iguana.tcpl.ca:82/survey-cgi/employee_survey/test_help.pl');
>
> document.help_layer.src =
> 'http://hr-iguana.tcpl.ca:82/survey-cgi/employee_survey/test_help.pl';
> }
> }
>
> ##################
> Heres the Perl Script :
>
> $| = 1;
>
> use CGI;
>
> $query = new CGI;
>
> print "Content: text/html\n\n";
>
> print "
>
> <html>
> <head>
> <title>This is a sample Help Text Layer</title>
> </head>
>
> <body>
>
> <h1>Hello there, I am in a new layer</h1><BR>
> ";
>
> print "You clicked on Coords (x,y) : (" , $query->param('x'), ",
> ",$query->param('y'), ")\n";
>
> print "
>
> </body>
> </html>
>
> ";
>
> ######################
>
> --
> Carey Bingham, B.Sc.
> Human Resources FST, TCPL
> Ritadon Inc.
>
> /\
> ____/ \____
>
> The typical Nintendo game involves controlling a little man running
> around a maze while numerous powerful and inexplicably hostile forces
> try to destroy him. In other words, it's exactly like real life.
> -- Dave Barry
--
Carey Bingham, B.Sc.
Human Resources FST, TCPL
Ritadon Inc.
/\
____/ \____
The typical Nintendo game involves controlling a little man running
around a maze while numerous powerful and inexplicably hostile forces
try to destroy him. In other words, it's exactly like real life.
-- Dave Barry