[Zope-dev] embed java script

Chris McDonough chrism@digicool.com
Tue, 25 Jan 2000 23:24:47 -0500


It's no different than authoring JavaScript in regular HTML...

A good strategy may be to put commonly-utilized JavaScript functions
inside <head></head> within your standard_html_header.  This method gets
displayed with every page that is rendered.  If your JavaScript stuff
isn't too big or complex, this wouldn't be very inefficient.  If you
have multiple standard_html_headers that are displayed on a site using
acquisition, just make a DTML method that holds the JavaScript function
stuff and include it in each standard_html_header that you use.  You're
really just factoring content here which is one of Zope's core
competencies.

Then within the body of each of your "real" documents (DTML documents or
DTML methods), call the JavaScript functions as if you were just
authoring HTML and the JavaScript existed "up top".

There's absolutely no magic to this... all you're doing is factoring
content.  JavaScript is executed on the client side and is therefore no
different than any other type of content in this respect.

HTH,

Chris


vvchen wrote:
> 
> Hi
>   I don't know howto embed java script like this in zope
> 
> <body bgcolor="#FFFFFF" topmargin="0" leftmargin="0" marginheight="0"
> marginwidth="0"
> onLoad="MM_preloadImages('images/nav2.gif','#945291788790')">  http-url
> in function argument
> 
>    maybe someone can tell me
>    thanks