wordpos/samples/cdn/index.html

54 lines
1.4 KiB
HTML
Raw Normal View History

2019-02-19 00:50:51 +00:00
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="script-src https: http: 'unsafe-inline' 'unsafe-eval'">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css" />
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/javascript.min.js"></script>
2019-05-24 21:18:55 +00:00
<!-- cdn source -->
2019-05-24 21:20:27 +00:00
<script src="https://unpkg.com/wordpos@2.0.0-beta/dist/wordpos.min.js"></script>
2019-05-24 21:18:55 +00:00
<script>
let wordpos = window.wordpos = new WordPOS({
// preload: true,
2019-05-24 21:20:27 +00:00
dictPath: 'https://unpkg.com/wordpos@2.0.0-beta/dict',
2019-05-24 21:18:55 +00:00
profile: true,
// stopwords: false
});
</script>
<script src="../main.js" name="main"></script>
2019-02-19 00:50:51 +00:00
<style>
pre {
padding: 2em;
display: block;
}
</style>
</head>
<body>
2019-05-31 13:19:46 +00:00
<h1>WordPOS CDN sample</h1>
2019-02-19 00:50:51 +00:00
Open console to see results.
<pre><code> </code></pre>
<script>
var el = document.querySelector('code');
if (fetch) {
2019-05-24 21:18:55 +00:00
fetch('../main.js')
2019-02-19 00:50:51 +00:00
.then(res => res.text())
.then(txt => {
el.innerText = txt;
window.hljs && hljs.initHighlightingOnLoad();
});
} else {
2019-05-24 21:18:55 +00:00
el.innerHTML = 'Open <a href="../main.js">main.js</a>.';
2019-02-19 00:50:51 +00:00
}
</script>
</body>
</html>