Home
» Knowledge base » Array.push() doesn't work in IE 5 ?
Older Javascript browser doesn't support array.push() method ?
How do I add element without using the push in javascript ?
Array.push() doesn't work in IE 5 ?
Older Javascript browser doesn't support array.push() method ?
How do I add element without using the push in javascript ?
2 August 2004, 10:48 am IST
User Rating: 7.1 (127 votes)
Older broswer including the IE5 doesn't support the array.push() method.
To overcome this disablility, you can use the following code to add the items to the array:
arSelected = array() // Initallize array
arSelected[arSelected.length] = 1; // Add value
arSelected[arSelected.length] = 17; // Add value
arSelected[arSelected.length] = 150850; // Add value
As you must have guess that this code will work safely in the new broswers too, so you can safely use this.


