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));
        }

}
--~--~---------~--~----~------------~-------~--~----~
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