Is it advisable to use arrays in Javascript using tens of thousands of indexes?

Is it advisable to use arrays in Javascript using tens of thousands of indexes?

I have a database which contains a table of static data, meaning that it will never change. In this case would it be advisable to convert this table to a javascript array and look the info up in there when needed? Is this bad practice?

The table in question contains roughly 40,000 key/value pair entries.

Answers


No.

I'd keep the table, as its a single point of maintenance.

You'll find that doing a XmlHTTPRequest to return a key/value pair based on a server side query, would actually perform faster, and have significantly less memory footprint than a huge JavaScript array.


Need Your Help

wordpress load plugin css/js in functions.php w/ conditional tags

wordpress wordpress-plugin conditional

so I have been trying to get plugin scripts/css to load only when needed. I have a catagory for posts called "review" , below in my functions.php I am trying to load the plugins only on posts with

Alternative to using c:out to prevent XSS

security spring jsp xss jstl

I'm working on preventing cross site scripting (XSS) in a Java, Spring based, Web application. I have already implemented a servlet filter similar to this example