473,406 Members | 2,293 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

alternative for eval in JavaScript?

6
I need to convert a JSON string which contains more than 1 lakh elements to json object. When i use eval in IE it throws out of memory error..
any other approach for this?
Mar 14 '12 #1
9 2595
Dormilich
8,658 Expert Mod 8TB
JSON.parse() or the parse()/decode() method of an arbitrary JSON (containing) library.
Mar 14 '12 #2
ammu86
6
all these are working fine if records not exceeded 70000
Mar 14 '12 #3
Dormilich
8,658 Expert Mod 8TB
70000 what? mice? cats? dollars?
Mar 14 '12 #4
ammu86
6
read my question and answer pls.hope u used to store cats and mice in JSON.
Mar 14 '12 #5
Dormilich
8,658 Expert Mod 8TB
I am not familiar with the indian (?) numbering system. I have no idea what 1 lakh is. so do others.
Mar 14 '12 #6
ammu86
6
there is no importance for the country in creating json structure. var myJson = '{ "x": "Hello, World!", "y1": [1, 2, 3] },"y2": [1, 2, 3] },"y3": [1, 2, 3] },"y4": [1, 2, 3] }';
eval throws out of memory error(in IE)if this exceeds 70k
Mar 14 '12 #7
Dormilich
8,658 Expert Mod 8TB
yes, objects require a bit of memory.
Mar 14 '12 #8
acoder
16,027 Expert Mod 8TB
For the record, 1 lakh = 100,000

ammu86, can you not split this data into chunks when it gets too large?
Mar 15 '12 #9
gits
5,390 Expert Mod 4TB
i would suggest that too - 70k is a lot of data and in case those records are for a grid/table or similar it is better to use a kind of paging mechanism then. from experience it is rather useless to present a user more then 100-150 lines in a table - since a) he/she cannot overview it and even has to scroll a lot and b) performance is bad, since it often implies lots of created DOM-nodes then.

if its not for a table but for a complex object - implement a 'lazy loading' mechanism (kind of 'paged object' where the pages are semanticaly structured properties) - and load data when they are needed.

regards
Mar 19 '12 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Bill | last post by:
Hi I have a form called 'store' with many fields, and I can update the 'name' field ok like this document.store.name.value = n; //this works fine but I want a function to update any field,...
6
by: Andy Fish | last post by:
Hi, I want to use an anchor tag to invoke some javascript and I've read that it's bad form to use <a href="javascript:foo()"> I've read endless usenet posts and hint sites on the net, they all...
8
by: Lucy | last post by:
help! javascript inline of an HTML to open an HTML in a target window. Something like... <html> <head> <title>test</title> </head> <body>
9
by: Michael Jaeger | last post by:
Liebe NG, ich betreue die web Seiten einer Schule und habe bislang ausschließlich HTML und CSS eingesetzt. Jetzt habe ich die Navigation auf Javascript umgestellt und dabei folgendes...
4
by: lltaylor | last post by:
Hello, Currently I use an onbeforeunload method, to do call various tidy up methods when a user exits my web application - however I now need to add additional support, for users migrating to...
5
by: crater | last post by:
Is there a way to get an HTML form to be submitted (via POST) by using an image button instead of a submit button for instance?
6
by: Michael Landberg | last post by:
Hi I am crewating a website using HTML and Javascript. The website can be seen by everybody that has internet. Do I have to consider that some people don't have javascript enabled in their...
2
by: Shankar | last post by:
Is there any way i can implement the eval funciton of java script in a normal java class ?
15
by: rage3324 | last post by:
I am posting html onto my main page between div tags using xmlhttprequest and innerhtml. The html I am posting has javascript inside which I am executing using the eval() function. However, the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.