to be clear - the example I put is not a javascript array but a Prototype
Hash

you should be able to do the same thing with a javascript array though

Jason Westbrook | T: 313-799-3770 | jwestbr...@gmail.com



On Mon, Oct 15, 2012 at 5:25 PM, Peter Sysko <petersy...@gmail.com> wrote:

> whoa i had no idea you could do that with javascript array. i just didn't
> think the data persistence was possible, even if the window was still open.
> but it makes perfect sense, and much simpler than what i'm doing now. I
> will have to give it a shot tomorrow, thank you!
>
>
> On Monday, October 15, 2012 2:15:23 PM UTC-4, Peter Sysko wrote:
>>
>> I love prototype and scriptacualous. I don't combine with jquery so i
>> know i am not having a noclonflict headache,
>> and I am just trying to get the visible() function (
>> http://prototypejs.org/api/**element/visible<http://prototypejs.org/api/element/visible>
>> )
>> to not throw null type error exceptions: here is the function I need to
>> fix, syntactically:
>> the function creates an associative array to track which of 33 system
>> panels are either open, unopen, or minimized*:
>> **(the systems are indexed from 100 to 132)*>>
>>
>> function get_system_states() {
>>     var k=0; var sys_array = new Array(); var open_div=''; var min_div='';
>>     for(k=100;k<132;k++){
>>         open_div = 'system'+k+'';
>>         min_div = open_div+'_minimized';
>>         if ($(open_div).visible()==true) {
>>         sys_array[k] = "o"; // o = open
>>         }
>>         if ($(min_div).visible()==true) {
>>         sys_array[k] = "m"; // m = minimized
>>         }
>>         if 
>> (($(open_div).visible()==**false)&&($(min_div).visible()=**=false))
>> {
>>         sys_array[k] = "c";    // u = unopen
>>         }
>>     }
>> return sys_array;
>> }
>>
>> Javscript console error says :
>>
>>    1. Uncaught TypeError: Cannot call method 'visible' of null
>>       1.
>>
>>
>> the first IF statement in the for loop is throwing the exception, but I
>> assume I am not assigning the div values correctly?
>> i have found no answers in this group from a text search and from a
>> general google search.
>> is this a single quotation reference? my div id's are dynamically written
>> in php codeignite, which shouldnt really matter.
>>
>> any suggestions for how to properly get the visibility of each div in
>> each current state?
>> thanks!!
>> -pete
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "Prototype & script.aculo.us" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/prototype-scriptaculous/-/dodF3TNhKR0J.
>
> To post to this group, send email to
> prototype-scriptaculous@googlegroups.com.
> To unsubscribe from this group, send email to
> prototype-scriptaculous+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to