Well, theoretically you could query the DOM to find out, but that would be a lot slower than just setting the instance variable and requesting it before rendering. On the other hand, the rendering method (provided that everything is set up correctly) should only be called when the model changes, so your question indicates that you are probably not using the view according to how it should be used (MVC style), But suppose you need to do this by setting this.rendered = true and checking this before rendering again in your rendering method is likely to be the fastest and easiest.
Marius kjeldahl
source share