Commit 073ed95cbbdf92f4bbeb88d236acb1c0d191aed6
1 parent
b8458851
Exists in
master
and in
7 other branches
Criação de função para executar a injeção de javascript (scripttag)
Showing
1 changed file
with
17 additions
and
0 deletions
Show diff stats
classesjs/classe_util.js
... | ... | @@ -1113,6 +1113,23 @@ i3GEO.util = { |
1113 | 1113 | document.body.removeChild(document.body.lastChild); |
1114 | 1114 | // Pixel width of the scroller |
1115 | 1115 | return (wNoScroll - wScroll); |
1116 | + }, | |
1117 | + scriptTag: function(js,ini,id){ | |
1118 | + if(id == ""){var id = "loadscriptI3GEO";} | |
1119 | + var head= document.getElementsByTagName('head')[0]; | |
1120 | + var script= document.createElement('script'); | |
1121 | + script.type= 'text/javascript'; | |
1122 | + if(navm){ | |
1123 | + script.onreadystatechange= function(){ | |
1124 | + if(this.readyState == 'loaded' || this.readyState == 'complete') | |
1125 | + {eval(ini);} | |
1126 | + }; | |
1127 | + } | |
1128 | + else | |
1129 | + {script.onload=function(){eval(ini);};} | |
1130 | + script.src= js; | |
1131 | + script.id = id; | |
1132 | + head.appendChild(script); | |
1116 | 1133 | } |
1117 | 1134 | }; |
1118 | 1135 | // | ... | ... |