<script>
var timestamp = new Date().getTime();
loadFile('tiny_mce_popup.js?'+timestamp, 'js');
loadFile('js/video.js?'+timestamp, 'js');
loadFile('css/video.css?'+timestamp, 'css');
function loadFile(path, type){
if (type=="js"){
var fileref=document.createElement('script');
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", path);
}else if (type=="css"){
var fileref=document.createElement("link");
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", path);
}
document.getElementsByTagName("head")[0].appendChild(fileref);
}
</script>
Reference:
http://cobwwweb.com/dynamically-add-javascript-and-css-files-to-your-website-using-javascript
No comments :
Post a Comment