Hacker News new | past | comments | ask | show | jobs | submit login

This would require some discipline in a shop using this. For one thing, one would want to have a convention where write() is not used or perhaps is disabled until the operation is safe. Also, this may be a form of optimization which is applied based on profiling. An app would benefit most from this on the pages most frequently viewed the earliest. ROI would increase for mature code which is changing less frequently.



I wouldn't ever think of `document.write` as 'safe.' If it happens to be called after the DOM is ready, you'll purge the DOM and blank the page. document.write can be useful for dynamically inlining new <script> tags in a way that older versions of IE are kosher with (which is why it's common in advertising), but in almost every other case, using the W3C DOM methods (or innerHTML) is a better decision.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: