From c3362c1685a04dbc8aaa179e4a36a5e919be0cf5 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Wed, 15 Apr 2015 09:03:46 -0600 Subject: [PATCH] Remove jQuery use from geolocation orientation example --- examples/geolocation-orientation.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/examples/geolocation-orientation.js b/examples/geolocation-orientation.js index 59ac348b20..f597c56e69 100644 --- a/examples/geolocation-orientation.js +++ b/examples/geolocation-orientation.js @@ -180,9 +180,18 @@ geolocateBtn.addEventListener('click', function() { // simulate device move var simulationData; -$.getJSON('data/geolocation-orientation.json', function(data) { - simulationData = data.data; -}); +var client = new XMLHttpRequest(); +client.open('GET', 'data/geolocation-orientation.json'); + + +/** + * Handle data loading. + */ +client.onload = function() { + simulationData = JSON.parse(client.responseText).data; +}; +client.send(); + var simulateBtn = document.getElementById('simulate'); simulateBtn.addEventListener('click', function() { var coordinates = simulationData;