Skip to content

Instantly share code, notes, and snippets.

@DamirSvrtan
Created May 26, 2012 23:11
Show Gist options
  • Save DamirSvrtan/2795577 to your computer and use it in GitHub Desktop.
Save DamirSvrtan/2795577 to your computer and use it in GitHub Desktop.
Take the variable proba and put it in to the Representative.get brackets
<script>
function getJson(){
var proba='http://0.0.0.0:4568/;
var stuff = <%= Representative.get('http://0.0.0.0:4568/') %>;
var data = "data:image/jpeg;base64, "+stuff.imageBase64;
setTimeout(function(){document.getElementById("X_Axis").value=stuff.acceleration.X_Axis}, 200);
setTimeout(function(){document.getElementById("Y_Axis").value=stuff.acceleration.Y_Axis}, 400);
setTimeout(function(){document.getElementById("Z_Axis").value=stuff.acceleration.Z_Axis}, 600);
setTimeout(function(){document.getElementById("Latitude").value=stuff.latitude}, 800);
setTimeout(function(){document.getElementById("Longitude").value=stuff.longitude}, 1000);
setTimeout(function(){document.getElementById("InternalTemperature").value=stuff.internalTemperature}, 1200);
setTimeout(function(){document.getElementById("Light").value=stuff.light}, 1400);
setTimeout(function(){document.getElementById("Distance").value=stuff.distance}, 1600);
setTimeout(function(){document.getElementById("Range").value=stuff.range}, 1800);
setTimeout(function(){document.getElementById("X_Axis_").value=stuff.magneticField.X_Axis}, 2000);
setTimeout(function(){document.getElementById("Y_Axis_").value=stuff.magneticField.Y_Axis}, 2200);
setTimeout(function(){document.getElementById("Z_Axis_").value=stuff.magneticField.Z_Axis}, 2400);
setTimeout(function(){document.getElementById("a").src=data}, 2600);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment