Opened 12 years ago

Closed 12 years ago

#4637 closed defect (fixed)

Calling dojo.require( "dijit.Editor" ) in javascript functions fails

Reported by: guest Owned by: James Burke
Priority: high Milestone: 1.0
Component: Core Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description

HOW TO REPRODUCE:

Go to http://82.230.65.68:31416/~fred/dojo/fred_samples/bug_009.html


EXPECTED RESULT:

A web page with some text and no error in console


RESULT:

An empty web page (Firefox2, OSX) and the following messages in the console:

failed loading  dojo/../dijit/Toolbar.js  with error:  TypeError: win.XMLHttpRequest.wrapped has no properties
failed loading  dojo/../dijit/Editor.js  with error:  Error: Could not load 'dijit.Toolbar'; last tried '../dijit/Toolbar.js'
[Exception... "'Error: Could not load 'dijit.Editor'; last tried '../dijit/Editor.js'' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001c (NS_ERROR_XPC_JS_THREW_JS_OBJECT)" location: "<unknown>" data: no]


Comments:

This make next to impossible to lazy load the library required to programmatically create a dijit.Editor. Such code works for other widgets.

Change History (3)

comment:1 Changed 12 years ago by bill

Component: DijitCore
Owner: set to James Burke

Seems like a loader issue?

comment:2 Changed 12 years ago by James Burke

Milestone: 1.0

Test page:

!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head><title>Dojo.require not working in javascript for Editor</title>
    <script type="text/javascript" src="dojo/dojo.js" djConfig="parseOnLoad:true" ></script>
    <style type="text/css">
        @import "dojo/resources/dojo.css";
        @import "dijit/themes/tundra/tundra.css";

    </style>
    <script type="text/javascript">

	dojo.addOnLoad( function() { dojo.require("dijit.Editor"); } );

    </script>
  </head>
<body class="tundra">
	<a href="http://trac.dojotoolkit.org/ticket/4637">trac #4637</a><br>

	This web page uses dojo.require( "dijit.Editor" ) in a javascript function. This generates a run time error under Firefox 2 OSX, which displays a blank page. 
</body>
</html>

comment:3 Changed 12 years ago by James Burke

Resolution: fixed
Status: newclosed

(In [10813]) Fixes #4637. Allow dojo.require for dijit.Editor to work in and addOnLoad function.

Note: See TracTickets for help on using tickets.