06-19-2007, 12:04 AM
I've always considered ECMAScript in general to be OOP:
I can understand how it can be confusing if you come from a stricter OOP language, but I consider the dynamics of this language (and its cousins) to be more expressive and powerful in general.
06-19-2007, 07:17 AM
06-19-2007, 11:00 AM
06-21-2007, 07:06 PM
one question while i'm on the subject...
if you have elements as memebers within your object and it comes to disposal time, i've read you removechild for each element, but do you "delete" the element itself? don't recall seeing anything about that.
so do free up an instance of a class, i would have something like dispose(obj) and dispose would free up each of it's members (that are, themeselves, objects) and then finally "delete" the object instance, itself. does that sound right? and again, do i need to delete element?
06-21-2007, 10:05 PM
unless you are not refreshing the page all day, don't worry too much about deleting elements.
JS does it's own internal garbage collection, and if you're avoiding unnecessary closures,( which it sound like you are), you have nothing to worry about.
you could also do all your 'heavy lifting' in a hidden iframe, pushing the results to top.document, and periodically, invisibly refresh the iframe.
06-22-2007, 06:12 AM
yeah, i wasn't thinking. i guess as long as it's a child, the browser will take care of cleanup. i'm really putting in the hours these days and making some dumb mistakes. i'll be taking a much needed 2 week break in a few weeks. i think my machine needs a break from me as well.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.