Created
May 22, 2012 07:12
-
-
Save girvan/2767274 to your computer and use it in GitHub Desktop.
load jquery from parent: modify from http://javascriptisawesome.blogspot.com/2011/07/dont-reload-jquery-on-your-iframes.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
if(typeof parent.jQuery !== 'undefined') | |
{ | |
var $ = function(a,b){ | |
b = b || document; | |
return parent.jQuery.apply(this,[a,b]) | |
}; | |
var jQuery = $; | |
} | |
else | |
{ | |
document.write(unescape("%3Cscript%20type%3D%22text/javascript%22%20src%3D%22//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js%22%3E%3C/script%3E")); | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment