All pastes #1725367 Raw Edit

temptag

public javascript v1 · immutable
#1725367 ·published 2009-12-23 22:31 UTC
rendered paste body
/** * este helper carrega scripts em tags temporárias e as remove em seguida. *  * @param uri *  */function TempTag(uri){		var tag = document.createElement("script");	var marcador = "variable"+(new Date().getTime())+"="+(new Date().getTime());	tag.src = uri.lastIndexOf("?") > -1 ? uri+"&"+marcador : uri+"?"+marcador;		tag.onload=function(){		document.body.removeChild(tag);	};		this.carregar=function(){		document.body.appendChild(tag);	};}