Gossamer Forum
Home : Products : DBMan : Customization :

onload event / javascript

Quote Reply
onload event / javascript
hi there,
is there any way to have a javascript onload event in the bodytag of all pagesdbman generates?

something like:

HTML Globals
##########################################################
# Put any globals you like in here for your html pages.
$html_title = ' Database Manager';
$html_body = 'onload="javascript:{if(parent.frames[0]&&parent.frames['Nav'].Go)parent.frames['Nav'].Go()}"';
##########################################################

i also tried to put that event into every single page like:

Home Page ##
##########################################################

sub html_home {
# --------------------------------------------------------
# The database manager home page.

&html_print_headers;
print qq|
<html>
<head>
<title>$html_title: Main Menu.</title>
</head>

<body onload="javascript:{if(parent.frames[0]&&parent.frames['Nav'].Go)parent.frames['Nav'].Go()}"'; >

etc

additionally i tried to call it via en external js, as suggested in on e of the earlier posts, but didnt have any luck.
PS: as you might have thought, i'm not too good with perl, but even though someone suggested one should not mix perl with js, i would be really grateful if someone could tell me if its a)possible and b) point me in the right direction.

thanks

olly

Quote Reply
Re: onload event / javascript In reply to
It isnt working because you are mixing single quotes in the js with the perl code.

Try:

Code:
$html_body = qq|onload="javascript:{if(parent.frames[0]&&parent.frames['Nav'].Go)parent.frames['Nav'].Go()}"|;
Mods:http://wiredon.net/gt/download.shtml
Installations:http://wiredon.net/gt/
Quote Reply
Re: onload event / javascript In reply to
hmm,
i tried that and the resulting code on , for example, the main page is:
<html>
<head>
<title>Database Manager: Main Menu.</title>

</head>

<body onload="javascript:{if(parent.frames[0]&&parent.frames['Nav'].Go)parent.frames['Nav'].Go()}">
etc.

which is exactly what works on all the other pages in the site, that dont have dbman in them
(am i right in thinking that i should insert <body $html_body> into the html.pl page as in:

##########################################################
## Home Page ##
##########################################################

sub html_home {
# --------------------------------------------------------
# The database manager home page.

&html_print_headers;
print qq|
<html>
<head>
<title>$html_title: Main Menu.</title>

</head>

<body $html_body>


<center>

etc?


Quote Reply
Re: onload event / javascript In reply to
oh, i forgot to mention:
it still doesn't want to work. :(