[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: Javascript missing

Michael Kress wrote:

> Hello,
Hello !

> generated, while using sub navbars.
> I'm just getting errors like:
> ------------------------------------------------------------------------------------------
> JavaScript Error:
> file:/var/local/offshore/aktuelle_Projekte/mohme/version_0_3/nodistr/wml/service-al.html,
> line 93:
> nb_imgOver is not defined. 

> Has anybody got any clue for that behaviour ? What can I do ?

this problem seems to be complex :

1) in /usr/lib/wml/include/des/navbar.wml file, there's a macro : 
<define-tag navbar:jsfuncs>
at the end of this macro there is this line :
<define-tag navbar:jsfuncs></define-tag>

so the JS code will be generated one time and only once ;

2) in /usr/lib/wml/include/std/tags.wml you'll find <javascript> macro.
the JS code is diverted with <head> tag (and [LANG_* ...)

so, JS code is diverted one time in page head where your (sub)navbar is 
define !

if you define <snb> before <page> tag  and if you have a .wml file per 
final .html page, or if you have a multipages .wml, your JS code may be 
diverted in a wrong <head> (you can debug this after pass 3)

a solution is to copy the <javascript> define-tag to make your own (eg 
MK_javascript) and modify the navbar:jsfuncs (un)define-tag (the kind of 
solution depends on multipages use or not)

but it's not finished, there's also another problem if you use 
multipages features :
you will have to modify /usr/lib/include/std/page.wml :
<head> and <title> definitions ends with :##}
replace it with :#WML_PAGE_HEAD_<get-var __std_page_cnt />#}
if you want JS code correctly diverted to each page_head

> Thanks for any helpful comment!
you're welcome

Jean-Michel Sauvage

Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com