Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
external-load
Advanced tools
This small library helps you to load external javascript / css from url
This small function helps you to load external CSS / Javascript from url.
It's helpful if you are using some framework, and code that you wanted to use is not directly supported by that framework, and you don't want to put load scripts into your html (why? code splitting).
Load is a immediately invoked function which returns 3 functions that you may use;
Load.js()
Load.css()
Load.img()
This functions take url and return promise. In case off error, you can catch it.
import Load from 'external-load';
Load.js('https://js.stripe.com/v3/')
.then( () => {
// Stripe is now avaliable
const stripe = Stripe(environment.stripeKey);
})
.catch( error => {
console.log(error)
})
This function is taken from David Walsh's [Create a Basic Loader with JavaScript Promises](Create a Basic Loader with JavaScript Promises) tutorial. Reason I'm publishing is; It's been very useful for me, and It's hard to find the code.
FAQs
This small library helps you to load external javascript / css from url
We found that external-load demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.