Skip to content

Commit

Permalink
Fixed jQuery not available
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenwf committed Mar 10, 2021
1 parent ce842e4 commit 40cc5d0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions api/event/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<body>
<!-- empty -->
</body>
</html>
16 changes: 8 additions & 8 deletions mirador.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<div id="mirador" class="mirador"></div>

<script type="text/javascript" src="//cdn.jsdelivr.net/npm/[email protected]/dist/mirador.min.js"></script>
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/[email protected]/fetch.min.js"></script>
<script type="text/javascript">

// Full list of settings available at: https://github.com/ProjectMirador/mirador/blob/master/src/config/settings.js
Expand Down Expand Up @@ -84,14 +85,13 @@

function logEvent(type, payload) {
payload.type = type;
$.post({
url: '/api/event',
data: JSON.stringify(payload),
dataType: 'json',
success: function() {
console.log('Successfully logged event [' + type + '] with payload [' + JSON.stringify(payload) + ']');
}
});
fetch('/api/event', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload),
}).then(function () {
console.log('Successfully logged event [' + type + '] with payload [' + JSON.stringify(payload) + ']');
})
}

function getManifestFromHash() {
Expand Down

0 comments on commit 40cc5d0

Please sign in to comment.