function xss_ajax(url, callback) { var script_id = null; var script = document.createElement('script'); script.setAttribute('type', 'text/javascript'); script.setAttribute('src', url); script.setAttribute('id', 'coolshell_script_id'); script.onload = script.onreadystatechange = function(){ if((!this.readyState || this.readyState === "loaded" || this.readyState === "complete")){ callback && callback(); } }; script_id = document.getElementById('coolshell_script_id'); if(script_id){ document.getElementsByTagName('head')[0].removeChild(script_id); } // Insert