In the title the error i get, this is the code, how can avoid the error, by the way the script works well even with the error
if(window.addEventListener){
window.addEventListener("message", myfunction, false);
}else{
window.attachEvent("onmessage", myfunction);
}
function myfunction(event) {
if (event.data !== 'null') {
dataJSONLocator = JSON.parse(event.data);
if (typeof dataJSONLocator == 'object' && dataJSONLocator.tntMessage !== undefined) {
if (dataJSONLocator.tntMessage) {
console.log(dataJSONLocator);
document.getElementsByName( "address1" )[0].value = dataJSONLocator.name + " " + dataJSONLocator.address;
document.getElementsByName( "city" )[0].value = dataJSONLocator.city;
document.getElementsByName( "id_state" )[0].value = dataJSONLocator.prov;
document.getElementsByName( "postcode" )[0].value = dataJSONLocator.cap;
} }
}
}
Just not give the error.
1