dimanche 28 juin 2015

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

Local Storage is used with Key 'Preferences' and content in JSON name: value: pairs.

Below is code my to populate a fieldset from that localstorage:

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