What is the contents of your "col0" variable?
If it's an array you should not use the "for (x in ...)" loop but a
traditional for (x = 0; x < y; x++) loop or Prototype's Array#each

If you post how you get the col0's contents setup I'm sure we can help you.

2008/5/8 Timebomb <[EMAIL PROTECTED]>:
>
>  I am trying to write some code using javascript and the prototype
>  library that makes sure certain divs are contained in a column div, if
>  they are not they get moved there. I'm getting the error "$(w_id) has
>  no properties" when I run it. Is it possible to programmatically build
>  a string containing a div id then use it like I need to? I'm new to
>  prototype. Thanks in advance.
>
>  Here is my code snippet:
>
>  var x;
>  var w_id = "";
>
>  //step through the first column
>  for( x in col0 ) {
>         w_id = 'w_' + col0[x];
>
>         //if the current item is not in col0, move it there
>         if( ! ($(w_id).descendantOf('col-0')) ) {
>                 $('col-0').insert(document.getElementById(w_id));
>         }
>
>  }
>  >
>



-- 
burnfield.com/martin

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to rubyonrails-spinoffs@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to