X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=blobdiff_plain;f=Pman.Include.js;h=3959cb4d7b9043766dc7fb12d624ec42f2992790;hp=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391;hb=586e4eb470252d837ba18b67e4c3c1702131fd1d;hpb=ceab091bdff695051ff149e47d7f50bfde85f41b diff --git a/Pman.Include.js b/Pman.Include.js index e69de29b..3959cb4d 100644 --- a/Pman.Include.js +++ b/Pman.Include.js @@ -0,0 +1,31 @@ +/** + * include a script -- normaly used for testing.. + * + * + */ + + +Pman.Include = function(sp) { + + Pman.Include.script(sp, true); + +} + +Pman.Include.cached = function(sp) { + Pman.Include.script(sp, false); + +} + +Pman.Include.script = function(sp,cached) { + var head = document.getElementsByTagName("head")[0]; + + + var script = document.createElement("script"); + script.setAttribute("src", rootURL + sp + + ( cached ? '' : '?ts=' + Math.random() ) + ); + script.setAttribute("type", "text/javascript"); + //script.setAttribute("id", trans.scriptId); + head.appendChild(script); + +} \ No newline at end of file