samedi 27 juin 2015

Why does this Javascript populate forms okay in Chrome and Firefox, but not Internet Explorer?

This is my code to populate a fieldset:

var fData = JSON.parse(localStorage.getItem('Preferences'));
if (fData) {
  for (var pair in fData) {      
    $('[name=' + fData[pair].name + ']').val(fData[pair].value);                        
  }
}

It works fine in Chrome and Firefox but not IE - any reason why not? How do I fix?

Aucun commentaire:

Enregistrer un commentaire