function getJSON(method, url, callback) { var request = new XMLHttpRequest(); request.addEventListener('load', callback); request.open(method, url, true); request.onload = function() { if (request.status >= 200 && request.status < 400) { //console.log(request.responseText); } else { console.log('server error'); } }; request.onerror = function() { console.log('error on request'); }; request.send(); } function get_login_form() { getJSON('GET', '/login/', function(e){ console.log(e); }); } //Global init for Quill function initQuill(el) { window.quill = new Quill(el, { modules: { syntax: true, // Include syntax module toolbar: [ [{ header: [1, 2, 3, 4, false] }], ['bold', 'italic', 'underline', 'blockquote'], [{ 'list': 'bullet'}, { 'list': 'ordered'},{ 'list': 'check'} ], ['link', 'code-block', 'image', 'video', 'formula',], [{ 'color': [] }, { 'background': [] }], // dropdown with defaults from theme [{ 'font': [] }], ] }, theme: 'snow', enable: false }); window.quill.on('text-change', function() { window.quillchange = true; }); }