Javascript: most efficient way to store/retrieve data on flat file

I'm creating light weight web-applications based on HTML and Javascript (for example a contact book with around 500 to 1000 entries). I have a simple HTML form to search in the contact list based on a few letters.

I want to store the entries on a flat file (.csv, .xml, . json or so) and then manipulate it with javascript to retreive the contact informations without any Ajax+php call.

My questions are:

  • Which is the best flat format to be manipulated with Javascript?
  • Is Javascript siutable for this kind of use, or I'm going to crash the user browsers by performing data research in my page?

Thanks for your advices! Nicolas


json is best option and it is designed for javascript.

Below are the sample json structure that you can use. { users: [ { un: 'johndoe', contactno: 123456 }, {un: 'acme', contactno: 4523456 }... ] }

json list can support large number of records and performance in performing operation on json list is quite fast.

make sure you are not performing dom manipulation during operation other performance degrades.

Need Your Help

Network on Main Thread exception while trying to send e-mails in Android without user intervention

java android networkonmainthread

I tried to implement the sending of emails without user intervention as explained in a post that's open for this issue:

How do I do something like 'print Dumper $var' in Embperl

perl embperl

How do I do something like 'print Dumper $var' in Embperl - I did this:

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.