By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,776 Members | 1,380 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,776 IT Pros & Developers. It's quick & easy.

PHP and Javascript

P: n/a
Hello there,
I have the folowing problem:
I need to use the <body onload="loadMenu()";"initDocument()"> but the first
javascript "loadMenu()" is in menu.php and initDucument() is in
content.php.

Now Non of these php files has a body tag in order to add the onload
Javascritp because I use a header.php and a footer.php which is included in
each php document.

I succesfully use the <body onload="loadMenu()"> in my header.php but if I
add the initDocument(). It won't work....

Does any of you ever did something similar and is able to give me a hint ?

Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Angelos" <an*****@redcatmedia.net> wrote in
news:d5**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com:
Hello there,
I have the folowing problem:
I need to use the <body onload="loadMenu()";"initDocument()"> but the
first javascript "loadMenu()" is in menu.php and initDucument() is in
content.php.

Now Non of these php files has a body tag in order to add the onload
Javascritp because I use a header.php and a footer.php which is
included in each php document.

I succesfully use the <body onload="loadMenu()"> in my header.php but
if I add the initDocument(). It won't work....

Does any of you ever did something similar and is able to give me a
hint ?


what exactly doesn't work?

let's suppose this is not a javascript problem (i.e. both function work
ok)

as far as i can understand header.php actually outputs the <body> tag.
why not

print '<body onload="loadMenu()";"initDocument()">';

there?

micha
Jul 17 '05 #2

P: n/a
Yo have too many "-signs
it should be

onload="loadMenu(); initDocument()"

Jul 17 '05 #3

P: n/a
On Thu, 12 May 2005 12:07:34 +0000 (UTC), Angelos wrote:
<body onload="loadMenu()";"initDocument()">


First of all, this has nothing to do with php.
Second, go read some html/dom documentation.

Try <body onload="loadMenu();initDocument()">
--
Firefox Web Browser - Rediscover the web - http://getffox.com/
Thunderbird E-mail and Newsgroups - http://gettbird.com/
Jul 17 '05 #4

P: n/a
"Angelos" <an*****@redcatmedia.net> wrote in message
news:d5**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...
Hello there,
I have the folowing problem:
I need to use the <body onload="loadMenu()";"initDocument()"> but the
first javascript "loadMenu()" is in menu.php and initDucument() is in
content.php.

Now Non of these php files has a body tag in order to add the onload
Javascritp because I use a header.php and a footer.php which is included
in each php document.

I succesfully use the <body onload="loadMenu()"> in my header.php but if I
add the initDocument(). It won't work....

Does any of you ever did something similar and is able to give me a hint ?


Don't include it in the <body> tag. JavaScript within the body will execute
upon loading. So, at the top of your content page (after the header that has
the <body> tag), put:

<script language="javascript">
loadMemu();
initDocument();
</script>
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.