87,997
社区成员




var basepath = navigator.basePath;
......
......
function A(){
this.LeftImg.src = basepath + "/images/left.gif";//此句出现问题
......
......
}
//-------------nav.js-------------
var basePath=navigator.basePath;
var icons = getIocns()
function getIocns() {
var icons=new Imagelist();
icons.path=basePath+"/console/images/tree/";
icons.type="gif";
icons.add("parent","default");
icons.add("expand","expand");
icons.add("collapse","collapse");
icons.add("children","link");
return icons;
}
//--------------tree.js----------
function Imagelist()
{
try{
var item=[]
count=0
this.path=""
this.type="gif"
this.err=""
iml=this
this.add=function(src,key)
{
var img=new Image()
if(src==null || src=="")return
if(src.indexOf("/")==-1)src=iml.path+src
if(!(/\.gif$|\.jpg$|\.png$|\.bmp$/i).test(src))src+="."+iml.type
if(key==null || key=="")key=src.replace(/(.*\/){0,}([^\.]+).*/ig,"$2")
item[count]=img;img.index=count;item[key]=img;count++;
img.onerror=function()
{
alert("Imagelist cause run time error:\nImage file "+img.src+" not found!")
item[img.index]=null;item[key]=null;count--;
}
img.src=src
return img
}
this.item=item
this.count=function(){return count;}
}
catch(e){
iml.err="alai_imagelist cause run time error!\nError number:"+e.number+".\nError description:"+e.description;
alert(iml.err);
return iml;
}
}