15 lines
532 B
JavaScript
15 lines
532 B
JavaScript
document.addEventListener('DOMContentLoaded', function() {
|
|
fetch('http://127.0.0.1:9898/routine.json')
|
|
.then(response => response.json())
|
|
.then(workout_json => {
|
|
// Use the JSON workout_json here
|
|
console.log(workout_json);
|
|
const wo = new Workout(document.getElementById("content-wrapper"),
|
|
workout_json);
|
|
wo.render();
|
|
})
|
|
.catch(error => {
|
|
console.error('Error fetching JSON:', error);
|
|
});
|
|
});
|