Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function abc() {
- $(function() {
- // do sth
- })
- }
- function addJQuery(callback) {
- "use strict";
- var script = document.createElement("script");
- script.textContent = "(" + callback.toString() + ")();";
- document.body.appendChild(script);
- }
- if (typeof $ === 'undefined') {
- if (unsafeWindow.jQuery) {
- $ = unsafeWindow.jQuery;
- abc();
- } else {addJQuery(abc);}
- } else {
- abc();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement