Skip to main content
100%

Inject a library from a cdn in any website through the console

✓ Published0🌍 Public
FFrozenfire92
Last edited Jun 30, 2015
Created on Jun 29, 2015

This example demonstrates a browser console script that injects the jQuery library into any website from a content delivery network. The code creates a new `<script>` element, sets its type to `text/javascript`, assigns the jQuery CDN URL as the source, and appends it to the document’s `<head>`. The snippet relies on the DOM API `document.createElement` and `appendChild` to perform the injection. It shows a manual, console-based method for loading external JavaScript dependencies without a package manager or build step.

AI-generated description

Similar vizzes