Closed yawboakye closed 4 years ago
I'm wondering if this should be merged in with part of the jqueryify snippet: https://github.com/bgrins/devtools-snippets/tree/master/snippets/jquerify. Any thoughts?
I see the relationship. Reason I put it in the same folder. Sure, I could work on merging them. How do you want it?
The way the build script works right now, it will either need to replace the current jquerify.js or be its own folder. I guess the main difference to jqueryify.js is that you just run it once and you instantly have jquery on your page. This has more power, but requires more steps. So after all, I'm thinking this should be its own snippet, with its own folder and README (called jquery-version
or similar as you did with the file).
How about we merge both so that running the snippet has the value of running jquerify.js, that is, have jQuery v2.0.3
inserted into the page as well as set up loadjQuery
, resetjQuery
, and JQUERY_VERSIONS
?
Sometimes you need a specific version of
jQuery
. Here you go! This snippet addsJQUERY_VERSIONS
) that contains all versions ofjQuery
(excludingbeta
s,a
s, andb
s)loadjQuery(version)
that loads the specified version or latest if version is not inJQUERY_VERSIONS
.resetjQuery()
that restores the state of the scope just beforeloadjQuery
kicked in.It appends only one script tag to the body no matter how many times it is called. Most of the time it doesn't manipulate the DOM if the version you want to load is the version already available.