Date:  06/16/2003 01:28:18 PM Msg ID:  001505
From:  FoxWeb Support Thread:  001504
Subject:  Re: javascript & DHTML
The problem is related to the fact that you are including the source of nsmenu.js and iemenu.js in the src clause of your <script> tags, instead of including a URL that points to the files.  Since these files are static, you should store them in your Web tree and use a URL that points to that location.  For exampe, if you store the two files in the JS subdirectory of your Web root (c:\inetpub\wwwroot\js ?), then the code should be changed as follows:
 
if((navigator.appName=="Netscape") && (parseInt(navigator.appVersion)==4)) {
document.write('<' + 'script language="JavaScript" type="text/javascript"
src="/js/nsmenu.js"><\/script\>');
} else {
document.write('<' + 'script language="JavaScript" type="text/javascript"
src="/js/iemenu.js"><\/script\>');
}

For more information on how to refer to static files in your scripts please read the Locating and Addressing Scripts topic of the FoxWeb documentation.

FoxWeb Support Team
support@foxweb.com email

Sent by Ramon Agui on 06/16/2003 10:25:21 AM:
I created a menu from DHTML menu builder and attach it to my page. but i can't figure out how to use it in foxweb. can somebody help me? here is the code generated.
 
<!-- DHTML Menu Builder Loader Code START -->
<div id=DMBRI style="position:absolute;">
<img src="dmb_i.gif" name=DMBImgFiles width="1" height="1" border="0" alt="">
<img src="dmb_m.gif" name=DMBJSCode width="1" height="1" border="0" alt="">
</div>
<script language="JavaScript" type="text/javascript">
var rimPath=null;
var rjsPath=null;
var rPath2Root=null;
 
function InitRelCode(){
var iImg;
var jImg;
var tObj;
if(!document.layers) {
iImg=document.images['DMBImgFiles'];
jImg=document.images['DMBJSCode'];
tObj=jImg;
}else{
tObj=document.layers['DMBRI'];
if(tObj){
iImg=tObj.document.images['DMBImgFiles'];
jImg=tObj.document.images['DMBJSCode'];
}
}
if(!tObj){
window.setTimeout("InitRelCode()",700);
return false;
}
rimPath=_gp(iImg.src);
rjsPath=_gp(jImg.src);
rPath2Root=rjsPath+"";
return true;
}
 
function _purl(u){
return xrep(xrep(u,"%%REP%%",rPath2Root),"\\","/");
}
 
function _fip(img){
if(img.src.indexOf("%%REL%%")!=-1)
img.src=rimPath+img.src.split("%%REL%%")[1];
return img.src;
}
 
function _gp(p){
return p.substr(0,p.lastIndexOf("/")+1);
}
 
function FixImages(){
var h=null;
var f=new Function("h","if(h)for(var i=0;i<h.length;i++)h[i]=xrep(h[i],'%%REL%%',rimPath);");
f(hS);
f(hshS);
}
 
function xrep(s,f,n){
if(s) s=s.split(f).join(n);
return s;
}
 
InitRelCode();
</script>
<script language="JavaScript" type="text/javascript">
function LoadMenus() {
if(!rjsPath){
window.setTimeout("LoadMenus()", 10);
return false;
}
var navVer = navigator.appVersion;
if(navVer.substr(0,3) >= 4)
if((navigator.appName=="Netscape") && (parseInt(navigator.appVersion)==4)) {
document.write('<' + 'script language="JavaScript" type="text/javascript" src="' +
<%filetostr('nsmenu.js')%>"><\/script\>');
} else {
document.write('<' + 'script language="JavaScript" type="text/javascript" src="' +
<%filetostr('iemenu.js')%>"><\/script\>');
}
return true;
}
 
LoadMenus();
</script>
<!-- DHTML Menu Builder Loader Code END -->