I have a micro controller that communicates between C and it's html server using json. I have two json files: status.json, and serial.json. status.json displays fine, but serial.json will not display for some reason?
I have confirmed that serial.json is displaying correctly on the html server so my issue will be from the javascript/JQuery/HTML code.
here is what /serialdata.json looks like
{"serial":"XXSerialTestXX"}
here is my jQuery/Javascript code
function getSerialData() {
$.getJSON( "/serialdata.json", function( data ) {
if(data.hasOwnProperty('serial') && data['serial'] != "") {
$("#serial").text(data["serial"]);
}
})
}
here is my html code
<div id="Instructions">
<h2>Follow These Intructions to set up your device</h2>
<section>
<body>follow these steps to set up your device!</body>
<div id="serial"></div>
</section>
</div>
if i change div id to to an id I set from status.json it works fine, but the serial id from serial.json does not work, does my code look fine?
getSerialData()?getSerialData()somewhere.