Opened 15 years ago
Closed 15 years ago
#355 closed defect (worksforme)
Requiring dojo.widget.RichText after page load overwrites entire page
Reported by: | srini | Owned by: | anonymous |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Widgets | Version: | 0.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
I don't know if this is by design, but if you dynamically call dojo.require("dojo.widget.RichText?"), the document.write() call inside of it clobbers the page when the code gets eval'd.
Example (with Editor which requires RichText?):
<html> <head> <script type="text/javascript" src="js/dojo/dojo.js"></script> <script type="text/javascript"> // widget build of dojo.js function doMakeRich() { dojo.require("dojo.widget.Editor"); var editor = dojo.widget.fromScript("Editor", {}, dojo.byId("california")); } </script> </head> <body> <div id="california">I live in California.</div> </body> <script type="text/javascript"> setTimeout("doMakeRich();", 2000); </script> </html>
The alternative is to load dojo.widget.Editor at the top of the case, but for my page, the editor is used only on demand and not very often. It would be nice to load the rich text editor's code on demand.
Note: See
TracTickets for help on using
tickets.
I'm able to load Editor2 using dojo.widget.createWidget(), so I'm thinking this has been resolved.