Skip to content

Instantly share code, notes, and snippets.

@codeb2cc
Created July 20, 2012 10:50
Show Gist options
  • Save codeb2cc/3150132 to your computer and use it in GitHub Desktop.
Save codeb2cc/3150132 to your computer and use it in GitHub Desktop.
Inserted Script
;(function () {
"use strict"
var doc = document
var head = doc.head ||
doc.getElementsByTagName('head')[0] ||
doc.documentElement
function scriptOnload(node, callback) {
node.onload = node.onerror = node.onreadystatechange = function () {
if (/loaded|complete|undefined/.test(node.readyState)) {
node.onload = node.onerror = node.onreadystatechange = null
if (node.parentNode) { head.removeChild(node) }
node = undefined
if (typeof callback !== 'undefined') { callback() }
}
}
}
var ns = {}
var jqueryNode = doc.createElement('script')
jqueryNode.async = 'async'
jqueryNode.src = 'js/jquery.js'
scriptOnload(jqueryNode, function () {
ns.$ = jQuery.noConflict(true)
})
head.appendChild(jqueryNode)
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment