Fetching contributors…
Cannot retrieve contributors at this time
28 lines (27 sloc) 1.16 KB
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Sample illustrating the use of tagtog API and JavaScript</title>
<p>This sample shows how to annotate text using tagtog, the API and JavaScript. You can serve this page from your local server.</p>
<p><button>Annotate a URL and check the result in console</button></p>
function annotateText() {
fetch('', {
method: 'GET',
headers: {'Authorization' : "Basic " + btoa('yourUsername' + ":" + 'yourPassword')},
}).then(response => response.text()).then(text => {
}).catch(function(error) {
console.log('Error: ', error);
var submitBtn = document.querySelector('button');
submitBtn.addEventListener('click', annotateText);