tags:

views:

50

answers:

1

Hi,

I am workin in a application in which i need to maintain the last accessed UI state(like column filters, sortings, selected records, resized widgets, columns, etc) of the page throughout the app session, this only terminated on the session end(and ll be posted to db on the session end either by manual logout or browser close). i have few things to ask

  1. I have a parent page that never refreshes(this is a framework page, and i don have control on this one). My page is on the frame, and this frame will be loaded with different pages on runtime. so i decided to create a list object in my parent page during runtime using like this

    parent.parent.parent.eval("var sam;") and fill my state objects (in JSON form) during the whole session.

is it recommented using this kind of approach?? is it ok to maintain this amount of data in client side?? am not much into javascript oject deallocation capablitites.. will it hurt the system on anyway??

  1. And i am maintaining JSON data array in my page which holds the some data, and it ll be maintained only on the page lifetime, it ll be terminated on page unload.. and this can grow based on the data in the page

I just started worrying, can browser hold this burden?? can someone suggest me the javascript best approaches on performance..

Cheers

Ramesh Vel

A: 

I understand what you're doing, but you don't really give us enough information to give a good answer. you ask

is it ok to maintain this amount of data in client side??

But you don't really tell us how much data you're working with.

Personally, I think you'll be fine. Storing moderate-to-large amounts of data will impact RAM which isn't a huge concern these days - the real performance issues with JavaScript come when you start doing really CPU-intensive stuff, like a lot of DOM interaction, large iterations, and recursion.

Oh, and I would probably encourage you to create variables in the frame's scope like this

top.varname = null;

as opposed to

parent.parent.parent.eval( 'var varname;' );
Peter Bailey
Ramesh Vel
Yeah, I think it's fine. Let's just put it this way - the volume of information you're talking about won't be performance concern.
Peter Bailey