/ Published in: JavaScript
Part of the script tag hack. Allows you to create a script tag on the fly from a url. The url could be a file containing info such as JSON or XML. Used in Ajax for crossing domains.
Expand |
Embed | Plain Text
function getScript(url){ var scriptTag = document.createElement("script"); scriptTag.setAttribute("type", "text/javascript"); scriptTag.setAttribute("src", url); document.getElementsByTagName("head")[0].appendChild(scriptTag); }
You need to login to post a comment.
