Hi,
I am dynamically including .js files on a button click. There is a segregated function to do the same. It doesnt seems to work well. If I put a alert tag in the includeJSFile function, it works well. Else it says init is not defined. Is there peculiarity in how function calls are terminated or something
I am attaching the code snippet below.
[CODE=javascript]
headTag.appendC hild(imageScrip tTag);
includeJSFiles( 'js/image-slideshow.js',' text/javascript');
includeJSFiles( 'OpenLayers-2.6/lib/OpenLayers.js', 'text/javascript');
includeJSFiles( 'OpenLayers-2.6/lib/Firebug/firebug.js','te xt/javascript');
includeJSFiles( "js/mapStandaloneBo x.js","text/javascript");
includeJSFiles( 'js/dom-drag.js','text/javascript');
init();
document.getEle mentById('GoVid ').onclick=chec kButtonCall;
checkButtonCall ();
}
}
}
function includeJSFiles( src,type) {
var headTag=documen t.getElementsBy TagName('head')[0];
var scriptTag=docum ent.createEleme nt('script');
scriptTag.src=s rc;
scriptTag.type= type;
headTag.appendC hild(scriptTag) ;
return true;
//console.log(hea dTag.innerHTML) ;
}
[/CODE]
I am dynamically including .js files on a button click. There is a segregated function to do the same. It doesnt seems to work well. If I put a alert tag in the includeJSFile function, it works well. Else it says init is not defined. Is there peculiarity in how function calls are terminated or something
I am attaching the code snippet below.
[CODE=javascript]
headTag.appendC hild(imageScrip tTag);
includeJSFiles( 'js/image-slideshow.js',' text/javascript');
includeJSFiles( 'OpenLayers-2.6/lib/OpenLayers.js', 'text/javascript');
includeJSFiles( 'OpenLayers-2.6/lib/Firebug/firebug.js','te xt/javascript');
includeJSFiles( "js/mapStandaloneBo x.js","text/javascript");
includeJSFiles( 'js/dom-drag.js','text/javascript');
init();
document.getEle mentById('GoVid ').onclick=chec kButtonCall;
checkButtonCall ();
}
}
}
function includeJSFiles( src,type) {
var headTag=documen t.getElementsBy TagName('head')[0];
var scriptTag=docum ent.createEleme nt('script');
scriptTag.src=s rc;
scriptTag.type= type;
headTag.appendC hild(scriptTag) ;
return true;
//console.log(hea dTag.innerHTML) ;
}
[/CODE]
Comment