Last active
February 17, 2017 02:28
-
-
Save lgh06/28d0d5a680dfcff411c3c5a4d231ddac to your computer and use it in GitHub Desktop.
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
| var rawframe = document.createElement('iframe'); | |
| document.body.appendChild(rawframe) | |
| var framedoc = rawframe.contentDocument; | |
| if (!framedoc && rawframe.contentWindow) { | |
| framedoc = rawframe.contentWindow.document; | |
| } | |
| var script = document.createElement('script'); | |
| script.type = "text/javascript"; | |
| script.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"; | |
| framedoc.body.appendChild(script); | |
| script.onload = ()=>{console.log(document.querySelector('body > iframe:last-child').contentWindow.jQuery) } | |
| // can get jQuery |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment