Get started with embed-js CDN
MIT licensed
The embed-js library is a lightweight JS solution for easily embedding external content into websites.
Tags:- JavaScript-plugin
- embed
- plugins
- JavaScript
- embed-js
- emoticon
- jquery-embed
Stable version
Copied!
How to start using embed-js CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with embed-js CDN - cdnhub.io</title>
<script src="https://cdn.cdnhub.io/embed-js/5.0.4/embed.min.js"></script>
</head>
<body>
<button id="loadEmbedButton">Load Embed</button>
<div id="embedContainer"></div>
<script>
document.addEventListener('DOMContentLoaded', () => {
const loadEmbedButton = document.getElementById('loadEmbedButton');
const embedContainer = document.getElementById('embedContainer');
loadEmbedButton.addEventListener('click', () => {
const iframe = document.createElement('iframe');
iframe.src = 'https://example.com';
iframe.width = '560';
iframe.height = '315';
iframe.frameBorder = '0';
iframe.allowFullscreen = true;
embedContainer.innerHTML = '';
embedContainer.appendChild(iframe);
embedJs('iframe')
.load('https://example.com')
.size('560', '315')
.autoplay(true)
.apiKey('YOUR_API_KEY') // Replace with your API key
.then(() => {
console.log('Embed loaded successfully');
})
.catch((error) => {
console.error('Error loading embed:', error);
});
});
});
</script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
All versions
2.0.0
2.0.0-rc.1
2.0.1
2.0.2
2.0.3
2.0.4
2.0.5
2.0.6
2.1.0
3.0.0
3.0.2
3.0.3
3.0.4
3.1.0
3.1.1
3.2.0
3.2.1
3.2.2
3.3.2
3.3.3
3.4.3
3.5.0
3.6.0
3.6.1
3.6.2
3.7.0
3.7.4
4.0.0
4.0.1
4.0.2
4.0.3
4.0.4
4.1.0
4.1.1
4.1.10
4.1.11
4.1.12
4.1.14
4.1.16
4.1.17
4.1.2
4.1.3
4.1.4
4.2.0
4.2.1
4.2.2
4.2.3
5.0.0
5.0.0-beta.0
5.0.0-beta.1
5.0.2
5.0.3
5.0.3-0
*** 5.0.4