JSON VS Javascript array
Moderator: General Moderators
-
shrikant_deshpande
- Forum Newbie
- Posts: 8
- Joined: Sat May 27, 2006 1:40 am
JSON VS Javascript array
Hello guys,
Can you please tell me who will be faster Json or Javascript array?
I have list of members (nearly 4000) .. I have to show them in combo dynamically...
Should I use JSON data or Java array?
Please guys help me out...
thanks
Can you please tell me who will be faster Json or Javascript array?
I have list of members (nearly 4000) .. I have to show them in combo dynamically...
Should I use JSON data or Java array?
Please guys help me out...
thanks
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
-
shrikant_deshpande
- Forum Newbie
- Posts: 8
- Joined: Sat May 27, 2006 1:40 am
Thanks Everah
Thanks Everah !Everah wrote:This seems like it would best fit in the Client Side forum, seeing as you are choosing between JSON and JS.
On a side note, can you test thest to see which would be faster? Also, since you are generating a dynamic select list, why not generate it server-side using PHP?
Thanks for helping me...
Actually let me tell you what is my problem...
I am using smarty template engine... and on the template page I have to show Autocomplete textbox for nearly 4000 members... So for this purpose I am using javascript... I am creating array of all the members....
(like gmail system)... So instead of using javaarray should I use JSON data...?
If you the answer please tell me...
Thanks once again
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: Thanks Everah
Gmail uses AJAX. I wouldn't attempt an Aut-Complete feature in JavaScript with over 4000 array members.
Look into doing this with a hybrid of server-client technology using AJAX
Look into doing this with a hybrid of server-client technology using AJAX
-
shrikant_deshpande
- Forum Newbie
- Posts: 8
- Joined: Sat May 27, 2006 1:40 am
Re: Thanks Everah
Thanks d11wtq !!!d11wtq wrote:Gmail uses AJAX. I wouldn't attempt an Aut-Complete feature in JavaScript with over 4000 array members.
Look into doing this with a hybrid of server-client technology using AJAX
Thanks for your help... But I am using smarty templates.. .. Do you think that it will work perfectly in case of templates...?
Thanks for feedback again...
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: Thanks Everah
I don't see why not, the template is parsed server-side. AJAX still does all of that stuff... it just does it behind the scenesshrikant_deshpande wrote:Thanks d11wtq !!!d11wtq wrote:Gmail uses AJAX. I wouldn't attempt an Aut-Complete feature in JavaScript with over 4000 array members.
Look into doing this with a hybrid of server-client technology using AJAX
Thanks for your help... But I am using smarty templates.. .. Do you think that it will work perfectly in case of templates...?
Thanks for feedback again...
-
shrikant_deshpande
- Forum Newbie
- Posts: 8
- Joined: Sat May 27, 2006 1:40 am
Re: Thanks Everah
Everah thanks for your reply..shrikant_deshpande wrote:Thanks Everah !Everah wrote:This seems like it would best fit in the Client Side forum, seeing as you are choosing between JSON and JS.
On a side note, can you test thest to see which would be faster? Also, since you are generating a dynamic select list, why not generate it server-side using PHP?
Thanks for helping me...
Actually let me tell you what is my problem...
I am using smarty template engine... and on the template page I have to show Autocomplete textbox for nearly 4000 members... So for this purpose I am using javascript... I am creating array of all the members....
(like gmail system)... So instead of using javaarray should I use JSON data...?
If you the answer please tell me...
Thanks once again
Thanks for your clarification...
I have found a nice solution for my problem...
Please go to this url = http://www.dhtmlgoodies.com/index.html?page=ajax
Here I have found the autocomplete list...in AJAX...
If you need any help in ajax please review above site...
Thanks bye
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
You know, I have code laying around somewhere that was developed by Glenn Vergara. When I find it I will try to post it or a link to it. It is an awesome OO Javascript application that does autocomplete (and a few other things). His site seems to be lost in cyberspace right now, but here is a link to a thread on CodingForums that might be able to help you as well.
I would agree with the other posters here that you really do not want JS running through 4000 records on an autocomplete. Using AJAX you can hit the server after every keystroke to get deeper into your list. Have a look at the Dictionary at Objectgraph.com. That uses AJAX with a .NET/SQL Server backend, but can be easily adaptd to suit your needs.
I would agree with the other posters here that you really do not want JS running through 4000 records on an autocomplete. Using AJAX you can hit the server after every keystroke to get deeper into your list. Have a look at the Dictionary at Objectgraph.com. That uses AJAX with a .NET/SQL Server backend, but can be easily adaptd to suit your needs.
-
shrikant_deshpande
- Forum Newbie
- Posts: 8
- Joined: Sat May 27, 2006 1:40 am
Thanks Everah ! thanks once again...
You are so kind to me... thanks...
Thanks for the links provided... Please tell me something about your self...
We can be good friends.... Also please provide me the list of nice and generous people like you (if you have)...
thanks once again..
Thanks for the links provided... Please tell me something about your self...
We can be good friends.... Also please provide me the list of nice and generous people like you (if you have)...
-
shrikant_deshpande
- Forum Newbie
- Posts: 8
- Joined: Sat May 27, 2006 1:40 am
I think javascript array is also a good choice, please go to the URL
http://www.developerzone.biz/index.php? ... &Itemid=45
http://www.developerzone.biz/index.php? ... &Itemid=45