I’ve been having a little problem with a JS function in Firefox. The expected result (which works accordingly in IE and Chrome) is that the server side code is executed and an array is returned in the LoadDetails function.
function ShowEvent(index) {
PageMethods.LoadDetailsEvent(index, LoadDetails);
}
function LoadDetails(val) {
document.getElementById('lblName').innerText = val[0];
document.getElementById('lblDate').innerText = val[1];
document.getElementById('lblTime').innerText = val[2];
document.getElementById('lblPlace').innerText = val[3];
document.getElementById('lblDescription').innerText = val[4];
$find('mpeShowEvent').show();
}
In the other browsers, the data is loaded into the labels correctly but in Chrome they appear with the default value.
What am I missing here?
innerTextis a non-standard property first introduced by Internet Explorer. The standard property istextContentbut you need at least IE9 for that. Alternatively you could use one of the cross-browser JavaScript libraries that handle the difference for you. Another approach is to alter the child text node’s data directly.