Get started with tern CDN
MIT licensed
Tern is a library providing just-in-time code completion for IDEs and text editors.
Tags:- analyzer
- cross-editor
- javascript
Stable version
Copied!
How to start using tern CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with tern CDN - cdnhub.io</title>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/min/codemirror.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/theme/monokai.css">
<script src="https://cdn.cdnhub.io/tern/0.24.3/tern.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/tern-simple-mode.min.js"></script>
<style>
#code-editor { width: 100%; height: 500px; }
</style>
</head>
<body>
<div id="code-editor"></div>
<script>
const editor = CodeMirror.fromTextArea(document.getElementById("code-editor"), {
mode: "text/javascript",
lineNumbers: true,
theme: "monokai",
});
Tern.init({
file: "/path/to/your/file.js", // Replace with the path to your JavaScript file
onReady: function () {
editor.setOption("lint", true);
},
});
</script>
</body>
</html>
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!
Copied!