Max Size for JavaScript Array Constructor?

Discussion in 'JavaScript' started by swese44, Oct 3, 2007.

  1. #1
    I need to process a list of about 99,000 Strings and I need to process the list on the client side to keep from freezing up the server. I'm using PHP to begin creating the JavaScript array constructor, then include the large file with the Strings (formatted with quotes and commas for the array):

    var items= new Array(<?php include $filename; ?>);
    Code (markup):
    I believe the max size for a JavaScript array is somewhere around 4 billion, but IE7 gives an Out of memory error and Firefox gives the error: too many constructor arguments.

    Is there a different limit for how many items can be added to a JavaScript array in the constructor?
     
    swese44, Oct 3, 2007 IP