JavaScript OOP problem

Posted by Danmark on Stack Overflow See other posts from Stack Overflow or by Danmark
Published on 2010-06-10T04:22:27Z Indexed on 2010/06/10 4:32 UTC
Read the original article Hit count: 110

Filed under:

I create windows like this:

var obj = document.createElement('div'); 
obj.className = 'window';
obj.style.width = 300 + 'px';
obj.style.height = 200 + 'px';
obj.style.left = 30 + 'px';
obj.style.top = 200 + 'px';     

//and so on

and what I need is to attach some data to each window. The data will be grabbed via Ajax and displayed in the windows. How should I do it so that each window hold its own unique data?

I don't need to display the whole data every time and this data would need be organized before being displayed, so I can't just add it with innerHTML. I need a way to hold it somewhere else where I could easily get it and then display it with innerHTML.

© Stack Overflow or respective owner

Related posts about JavaScript