I'm trying to reload a page with an appended variable in the URL, deviceID. It shows up in "realtime" div just fine. What am I doing wrong?:
document.getElementById("realtime").innerHTML = "<pre>"+JSON.stringify(msg)+"</pre>";
var obj = jQuery.parseJSON(JSON.stringify(msg));
var deviceId = obj.deviceId;
var pathname = window.location.pathname;
var pathAppend = pathname + "?deviceId=" + deviceId;
window.location.reload(pathAppend);