dev.mikamai.com/post/77379031823/jquery-injection-for-profit-and-profit-cause...

Working on a project for an important client (more on that in the next months), we came up with the need to inject jQuery on a page, making it available to your functions.

In addition to that we wanted to be sure it didn’t conflict with other jQueries the page was already using, and, if a new version of jQuery was already available, use that instead of injecting a new one.

This whole injection thing is not very complicated per se. You just have to be sure you’re not messing up with what’s already in the page.

Let’s walk through our solution to see how we implemented it. All the code you see here will be CoffeeScript, the javascript translation is really straightforward and won’t be provided :)

We start with an empty html document, something like this:

<!DOCTYPE html> <head> <meta charset=


Comments (0)

Sign in to post comments.