I am trying to insert an key/value pair into a serializeArray(from jquery).
So I have something like
var form = $('#form');
var sendFormData = form.serializeArray();
sendFormData.push({ "name": "Name", "value": "test"});
In firefox this works yet in IE 8 I get
Line: 51 Error: Object doesn’t support
this property or method
So it seems to be pointing to this line. So does ie 8 not support push if so what is a way I can add a key/value pair that will work in all browsers(the 5 mains ones firefox, ie8, chrome, opera, safari)
What you have works (even in IE8), you can test it here: http://jsfiddle.net/ZAxzQ/
There must be something outside the question that you’re doing to get that error 🙂
.push()has been around as long as the Array object, I’ve never seen a browser that doesn’t support it…your unsupported error has to be coming from something else.