Login Register

Editor

Dijit's Rich Text editor, Dijit.Editor, is a text box on steroids. Designed to look and work like a word processor. The editor features a toolbar, HTML output, and a plugin architecture that supports new commands, new buttons and other new features.

Examples

The default configuration of Dijit.Editor has a toolbar along the top with icons for Copy, Cut, Paste, Bold, Italic, Underline, Numbered and Bulleted Lists, and Indent Left and Right.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Editor Demo</title>
    <style type="text/css">
        @import "http://o.aolcdn.com/dojo/1.0/dijit/themes/tundra/tundra.css";
        @import "http://o.aolcdn.com/dojo/1.0/dojo/resources/dojo.css"
    </style>
    <script type="text/javascript" src="http://o.aolcdn.com/dojo/1.0/dojo/dojo.xd.js"
        djConfig="parseOnLoad: true">
</script>
        <script type="text/javascript">
       dojo.require("dojo.parser");
       dojo.require("dijit.Editor");
     </script>
</head>
<body class="tundra">
<form method="post">
<textarea name="field" width="200px" dojoType="dijit.Editor">
        It was a dark and stormy night.  Your story belongs here!
</textarea>
<input type="submit" value="Save" />
</form>
</body>
</html>

Toolbar Customization

You may limit the commands people can perform, such as removing the Indent Left button. Each button corresponds to a plugin, hence you specify toolbar buttons with the plugins attribute. For example, the following toolbar includes copy, cut, paste and bold:

<textarea dojoType="dijit.Editor" height="200"
    plugins="['copy','cut','paste','|','bold']">
</textarea>

The plugins attribute is specified in JavaScript array literal format. Here is a list of built-in plugins that you can reference: (names are case sensitive and those in italics are not yet implemented)

  • Character Formatting: bold, italic, underline, strikethrough, subscript, superscript, removeFormat, forecolor, hilitecolor
  • Paragraph Formatting:: indent, outdent,justifyCenter, justifyFull, justifyLeft, justifyRight, delete, selectall
  • Inserting Objects:insertOrderedList, insertUnorderedList, createlink (use LinkDialog plugin), inserthtml
  • Misc.: undo, redo, cut, copy, paste
dijit.Editor (Rich Text Editor)
Attributes
captureEvents String[]
[]
Events that should be connected to the underlying editing area, events in this array will be addListener with capture=true
customUndo Boolean
true for IE
Whether to use custom undo/redo support instead of the native browser support. By default, only enable customUndo for IE is available, as it has broken native undo/redo support. Note: the implementation does support other browsers which have W3C DOM2 Range API.
editActionInterval Integer
3
When using customUndo, not every keystroke is saved as a step. Instead typing (including delete) will be grouped together: after a user stop typing for editActionInterval seconds, a step will be saved; if a user resume typing within editActionInterval seconds, the timeout will be restarted. By default, editActionInterval is 3 seconds.
events String[]
["onKeyPress", "onKeyDown", "onKeyUp", "onClick"]
Events that should be connected to the underlying editing area
focusOnLoad Boolean
false
Whether focusing into this instance of rich text when page onload
height String
300px
Set height to fix the editor at a specific height, with scrolling. By default, this is 300px. If you want to have the editor always resize to accommodate the content, use AlwaysShowToolbar plugin and set height=""
inheritWidth Boolean
false
Whether to inherit the parent's width or (if false) simply use 100%.
isClosed Boolean
true
isLoaded Boolean
false
minHeight String
1em
The minimum height that the editor requires
name String If a save name is specified, the content is saved and restored when the user leaves the page and returns, or if the editor is not properly closed after editing has started.
onLoadDeferred dojo.Deferred Deferred can be used to connect to the onLoad function. This will only be set if dojo.Deferred is required
plugins See plugin section
styleSheets String Semicolon (";") separated list of .css files for the editing area.
toolbar dijit.Toolbar DOM Node To use your own custom toolbar
updateInterval Number
200
Number of ms between display changes for onNormalizedDisplayChanged
Methods
addKeyHandler(/*String*/key, /*Int*/modifiers, /*Function*/handler) Add a handler for a keyboard shortcut
addPlugin(/*String||Object*/plugin, /*Integer?*/index) Takes a plugin name as a string or a plugin instance and adds it to the toolbar and associates it with this editor instance. The resulting plugin is added to the Editor's plugins array. If index is passed, it's placed in the plugins array at that index. No big magic, but a nice helper for passing in plugin names via markup.
addStyleSheet(/*dojo._Url*/uri) Add an external stylesheet for the editing area
beginEditing(/* String */cmd) Set mark for capturing undo steps
close(/*Boolean*/save, /*Boolean*/force) Ends the editor and optionally writes back the modified contents to the element from which it originated.
endEditing(/* Boolean */ignore_caret) Clear the undo buffer, as in after a save
exec(/* String */cmd) Execute given command
String escapeXml(/*String*/str, /*Boolean*/noSingleQuotes) Adds escape sequences for special characters in XML: &<>"' Optionally skips escapes for single quotes
open(/*DomNode?*/element) Transforms the node referenced in this.domNode into a rich text editing node. This results in the creation and replacement with an iframe if designMode(FF)/contentEditable(IE) is used.
placeCursorAtEnd() Place the cursor at the end of the editing area
placeCursorAtStart() Place the cursor at the start of the editing area
Boolean queryCommandAvailable(/*Boolean*/ disabled) Tests whether a command is supported by the host. Clients should check whether a command is supported before attempting to use it, behaviour for unsupported commands is undefined.
Boolean queryCommandEnabled(/* String */cmd) Checks whether a command is enabled or not
Boolean queryCommandState(/*Boolean*/ disabled) Checks the state of a given command
String queryCommandValue(/* String */cmd) Checks the value of a given command
redo() Redoes last un-done command
removeStyleSheet(/*dojo._Url*/uri) Remove an external stylesheet for the editing area
replaceValue/*String*/html This function sets the content while trying to maintain the undo stack (currently, this only works okay with Moz, this is identical to setValue in all other browsers)
undo() Undo last command
Extension Points
onChange This is initiated if the editor loses focus and the content is changed
onDisplayChanged This event is initiated each time the display context changes and the result needs to be reflected in the UI. If you do not want to have the update too often, use onNormalizedDisplayChanged instead
onNormalizedDisplayChanged This event is initiated on each updateInterval ms or more
setupDefaultShortcuts() Override to setup your own handlers. The default implementation does not use Editor commands, but directly runs the builtin commands within the underlying browser support.

Accessibility (Applies to 1.0 version of editor)

Keyboard for Editor

ActionKey
Move focus to the next widget in the tab order.Tab (must press tab twice in some situations - see Known Issues below)
Move focus to the prior widget in the tab order (the editor toolbar)Shift+Tab (must press shift-tab twice in some situations - see Known Issues below)

Keyboard for Editor Toolbar

ActionKey
Move focus to the next enabled button in the toolbar.arrow right in left to right locales, arrow left in right to left locales
Move focus to the previous widget in the toolbararrow left in left to right locales; arrow right in right to left locales.

The arrow keys will not work within any optional drop down lists such as ComboBox or FilteringSelect in the editor toolbar until the drop down list of choices has been activated. Use the backspace or escape key to clear the current selection in the textbox associated with the drop down. When the list of choices is not activated, the arrow keys will move between toolbar buttons rather than within the combobox or select.

Known Issues

  • On Firefox, the user must press the Tab key twice before keyboard focus moves to the next widget. This is a permanent restriction on Firefox 2. The reason for this is because Firefox implements usage of the tab key within the editor to indent text and shift-tab to outdent text. There is no keyboard mechanism in Firefox to move focus out of the editor. So, the dijit editor traps the tab key in the editor and sets focus to the editor iframe. From there pressing tab again will move to the next focusable item after the editor. When shift-tab is pressed within the editor, focus is set to the toolbar associated with the editor (currently there is always a toolbar defined for a dijit editor). Even though Firefox 3 now supports the use of the contentEditable attribute to create the editor using a div element, the dijit editor is still implemented using an iframe in Firefox 3 and this tabbing issue remains. Some people are unhappy with the loss of the tab key functionality within the editor. Version 1.2 includes a plug-in option to allow the use of tab and shift-tab within the editor to indent and outdent text.
  • In IE6 or 7 when the editor has been created from a textarea the user must press tab twice to set focus into the editor to begin inserting or editing text. Likewise, with focus within editor text the user must press shift-tab twice to set focus back to the toolbar.

Can anybody tell me, how do

Can anybody tell me, how do retrieve value of Rich text editor

getValue()

... as in dijit.byId("myEditor").getValue(false). Use "false" to leave the editor text intact, or "true" to erase it from the box itself. getValue returns the same value either way.

I am in the process of updating the docs for 1.0...

Loading plugins

Under the list of plugins available it says that createlink is an available type, and that I should use the LinkDialog plugin, but adding LinkDialog or createlink to the plugins attribute of the editor tag does nothing.
Is there another way to go about this? Am I missing something?

Update

I have been playing around with the addPlugin function (I don't know why adding it to the attribute list in the tag doesn't work) and am still having problems.

I do a dojo.addOnLoad to call my addPlugin function and it tells me the editor does not exist. Then I changed my addOnLoad to addOnLoad( setTimeout("initEditor()", 1000) ) which works. Now, no matter what information I pass the addPlugin function, I get a javascript error mll[x] is not a function on dojo.js line 20.

addPlugin

I think the addPlugin function needs to be run after the editor is created (takes some time)
Have you tried running addPlugin() in the editor's onLoadDeferred function??

I got it to work

Thanks for the tip playwithdojo, it got me headed the right direction.

For anyone else who runs into this trouble, here is the final code I ended up with:

dojo.require("dojo.parser");
dojo.require("dijit.Editor");   
dojo.require("dijit._editor.plugins.LinkDialog");       

dojo.addOnLoad( setTimeout("initEditor()", 1500) );

function initEditor(){
     dijit.byId("editor").onLoadDeferred.addCallback = addEditorPlugins();      
}

function addEditorPlugins(){
     p = new dijit._editor.plugins.LinkDialog({});           
     dijit.byId("editor").addPlugin(p);
     return;
}

Here is a list of things that I couldn't get to work:

  • Calling addPlugin(string), only initializing it myself worked
  • Calling initEditor without the setTimeout, for some reason the editor doesn't exist about 50% of time when the addOnLoad functions get called
  • Get the 'mll[x] is not a function' error to go away. Even with the code above it still shows up even though everything seems to be working

After you dojo.require

After you dojo.require LinkDialog, then you can easily put it in the html element with plugins="['createLink']".

I would like to use the innerHtml plugin as well, but it doesn't seem to be listed in the plugins directory...

Rich Text Editor value workaround

This works for me.

In my html:

Sample text
		
    

    Save
        
            saveRichText('richText', dijit.byId('tresc').getValue());
            dojo.xhrPost({
		url: 'lib/saveIt.php',
                load: function(data){
                    alert(data);
		},
                error: Error,
                form: 'myForm'
            });
        
    

The saveRichText() function in my header:

function saveRichText(id, str){
    document.myForm[id].value = str;
}

The saveIt.php file:

<?php

    if(isset($_POST['richText'])){
        $richText = $_POST['richText'];
    } else {
        $richText = 'error';
    }
    print $richText;
?>

I've slimmed down the example, but that's basically it. I use this method to save rich text in mySQL database.

document.myForm and XHTML

I using XHTML strict and i get an error the docuemt.myForm has no properties. Has anyone an idea?

I also have this problem

Same for me, document has no properties ... :(, anyone knows why ?

Find the problem

The form beyond the texterea must have the same name. For example: you use document.myForm[id] = str; myForm is the same name as the name of the form. I actualy don't know if the html 4.0.1 can work with ids but xhtml 1.0 needs also the name with the same name.

Dumb question, what's the opposite of getValue??

I put in a test for FF. If FF, I successfully do:
dijit.byId('editor1').replaceValue(myrawhtml)

However, if NOT FF, I try:
dijit.byId('editor1').setValue(myrawhtml)

but it doesn't work. I tried just jamming it into the inner html of my textarea, but that object seems to go away in favor of some kind of iframe. I tried dinking around with that but could only get non-editable text to display.

What's the solution? I love this thing, but it's kinda useless if I can't load up and edit a pre-existing html block.

P.S. Not wanting to mess with servers and db's, I'm using the clipboard rather successfully to move stuff back and forth to notepad. Also, I'd like to try letting the user switch back and forth between the tagged "raw" window and the rich window. I think I need to be able to stuff the content back and forth (and a keyup event), no?

PLEASE HELP: how can I dynamically put content into the editor?

My customer really likes this. The only thing that stops him from using it is that he's on IE and I can't figure out how to dynamically put raw HTML into the edit iframe from within javascript.

Is there a work-around for the lack of replaceValue in IE?

There is no file out there to load into the iframe's src tag; the raw html is being created on the client in js based on conditions.

I did try replacing my original container div's innerHTML with a brand-new textarea html string with the dojoType="dijit.Editor" attribute (and with my new raw html content imbedded within the textarea), but I couldn't figure out how to trick dojo/dijit into re-scanning it to find the dojoType and replace the textarea with the iframe and re-load the plugins, etc..

Solution: Dynamically putting content into editor window

I'm sure what I did isn't elegant, but it kind of works. The magic incantation for IE is:

var ewin = document.getElementById("editorwindow")
var ifr = ewin.getElementsByTagName("iframe")
ifr[0].contentWindow.document.body.innerHTML = stx

(assuming you have a containing div with id="editorwindow")

I have a demo of an editor that allows you to toggle between tabs for Rich Text and Raw HTML. It also copies a starting point HTML source off the clipboard if you want and will post the resulting HTML to the clipboard (FF users will have to enable that behavior, instructions provided if it fails).

http://wellhost.com/dojoedit.html

I'm sure I missed something and this whole thing won't work somehow...

For one thing, I notice that leading comments inserted in the Raw tab get dropped for some reason when I switch back and forth. Sigh. That makes me wonder if a lot of other things will break -- probably that flakey innerHTML call. Suggestions welcome.

Raw tags? BR tag?

Of course, if you enter leftbracket + br + space + solidus + rightbracket, it's going to get saved with all the ampersand + gt + semicolon indirection.

This is a good thing.

But: is there a way to allow the user to enter a raw html tag and actually have it do something?

One pet peeve I have is the inability to insert br linebreak tags when using HTML editors. I'd actually prefer to change the Enter key behavior to do that instead of p tags and let user hit enter a couple of them if s/he really wants all that space.

I know that br tags probably aren't kosher xhtml or whatever, but sometimes a guy just wants a simple linefeed!

Is there any way for getting the HTML tags for a selected text ?

Hi,

Is there any way for retrieving the HTML tags that are applied for a selected portion of a text in the Editor widget ?

For example, I am having a line of text in bold and a second line in italics entered in the editor widget. If I am selecting the first line, I need a way for getting the HTML tags that are applied to the first line (selected portion).

Thanks in advance,

Binu Paul < binu@amtindia.co.in>

----------------------------------------------------------------------------------------------------------------
Code snippet:

var docObj = dijit.byId('txtarea').window.document ;
var selText = docObj.getSelection();
var nodeCount = dijit.byId('txtarea').window.frameElement.contentDocument.childNodes[0].childNodes[1].childNodes.length;
var win = dijit.byId('txtarea').window;
var doc = dijit.byId('txtarea').window.document;
var gs = 'getSelection';
var sel = w[gs] ? w[gs]() : d[gs] ? d[gs]() : d.selection.createRange().text;

if ((selText.length > 0)) {
console.info("Selected text = " + selText);
console.info(sel.anchorNode);
console.info(sel.focusNode);
}

for( i=0; i< nodeCount; i++) {
console.info(dijit.byId('txtarea').getNodeHtml(dijit.byId('txtarea'). window.frameElement.contentDocument.childNodes[0].childNodes[1].childNodes[i]));
}

Sharing a toolbar across multiple text areas

Does the RichTextEditor support a shared toolbar? I want to have multiple content areas on a page that are all managed with the same toolbar. I believe this was possible with the old Editor2, right?

I've tried creating a Toolbar and passing that in as a reference to each instance of the Editor that I create, but this results in the Editor plugins being added to the toolbar multiple times, once for each text area I want to edit. Any ideas as to how to work around this?

known issue

Hi,
I wanted to know, how do we enable focus to this text area using a single tab instead of using 2 tabs currently. Please help.

The known issue states that to set focus into a rich text field from any other field, we must press tab twice. How to overcome this issue.

Regards,
Naren.

tab to toolbar

I think it's currently designed such that one tab takes you to the toolbar and then another tab takes you to the editor, which was done to be consistent with usability and a11y guidelines. Once inside the toolbar or the editor, you can navigate within those widgets using the keyboard, and screen readers use the focus as context to relay state to the user.

How to make the dijit.editor support spell check

Hi,
Maybe this question is silly, but I am wondering whether some one can give me some helpful advise.
I downloaded the dojo 1.0 build in my PC and installed it to my apache server. I can see that dijit.editor widget in the mail demo supports the spell check feature very well. However I can not make the spell check work in my own widget with the dijit.editor widget.
And also, the online editor widget dose not support this feature both in FF2 and IE7.
Is there something should be paid more attention here to support the spell check?

Thanks
- Bruce

Spell Check

I, too, am interested in this.

I do get spellcheck in all my browser windows since I installed ASpell freeware. However, that doesn't help my web users. I'd like it to be an automatic part of my demo dojoeditor (see above).

Enable Color-Support in Editor Widget

Just to add some details which I could not find in the documentation:

If you want to enable setting the fore- and background colors, you have to load the appropriate plugin first:

dojo.require("dijit._editor.plugins.TextColor");

Plugin-names are case-sensitive, to enable the buttons in the Editor's toolbar in declarative mode write something like this:

<textarea name="field" width="200px" dojoType="dijit.Editor"
plugins="['bold','italic','underline','|','foreColor','hiliteColor'">
</textarea>

The plugin names are misspelled in the documentation. Could somebody please correct that? Thanks.

entering edit mode programaticaly

How can I enter focus in the editing area of the widget programaticaly?

Using Dijit Editor Value with a normal form submission

The Dijit Editor doesn't pass it's value when submitting the form naturally (in Firefox 2 at least).

There are other methods listed on this page which involve using XHR, or monkeying with the core dijit files. My method is a bit more straightforward: just recreate the textareas when the submit event fires.

HTML:

<form dojoType="dijit.form.Form" id="djtForm">
    <textarea dojoType="dijit.Editor" name="someTextarea" id="someTextarea">
    <input type="submit" onclick="return fSubmitDojoForm('djtForm')" />
</form>

JAVASCRIPT:

function fSubmitDojoForm(dijitForm) {
    if ( dojo.isString(dijitForm) ) dijitForm = dijit.byId(dijitForm);
    if ( dijitForm.validate() ) {
        if ( dojo.isFF ) {
            var aDijits = dijitForm.getDescendants();
            var dijitChild, sName, sValue, eTextarea;
            for ( var i=0, max=aDijits.length; i<max; i++ ) {
                dijitChild = aDijits[i];
                if ( dijitChild.domNode.className.indexOf('RichTextEditable')!=-1) {
                    sName = dijitChild.domNode.getAttribute('widgetid');
                    sValue = dijitChild.getValue();
                    eTextarea = document.createElement('textarea');
                    dijitForm.domNode.appendChild(eTextarea);
                    eTextarea.name = sName;
                    eTextarea.value = sValue;
                    eTextarea.style.display = 'none';
                }
            }
        }
        dijitForm.submit();
    }
    return false;
}

NOTES:

1. I haven't checked how other browsers (Opera, Webkit, Konqueror) behave.

2. I used a quick and dirty way of deciding if something was an Editor widget (I'm *sure* dojo has some kind of dojo.isInstanceOf() method, but I'm lazy).

3. This assumes the original textareas have identical name and id attributes.

4. The display:none css rule is just a nicety.

5. I use a form of hungarian notation (eFoo is an HTMLElement, aBar is an Array, sBaz is a String, fEck is a Function, etc). You might want to start doing the same, it's very helpful.

6. This code is abstracted out of a set of other files - there may be typos / bugs!

Re: Using Dijit Editor Value with a normal form submission

UPDATE: It is only Firefox (2.0.0.14 and 3Beta5) that displays the "Editor contents not included with form" behaviour. Well ... ok, I haven't tested Konqueror, but IE 6, 7, Safari (Windows) and Opera 9.5 all submit the data just fine.

folowing your idea...

<textarea dojoType="dijit.Editor" minHeight="5em" id="sdescription" name="sdescription" updateInterval="500">
                some description
        </textarea>
        <textarea style="display: none;" id="description" name="description">some description</textarea>

and than:

dojo.addOnLoad(function() {
                        var widget = dijit.byId('sdescription');
                        widget.name = 'description';
                        dojo.connect(widget, 'onChange', function(){
                        widget.endEditing();
                        var desc = widget.getValue();
                        var stext = dojo.byId('description');
                        stext.value = desc;
                        });
                });

I didn't have a chance to test it in other browsers than FF3 on Ubuntu but I don't see why it wouldn't work in any other browser.
It could be done more elegant for sure.
I feel this is kind of bug. It would be great to see some normal way to do it.

another variation for submitting in Firefox

This does two things I couldn't do with the example code.

1) The editor now displays properly (I just got a plain textarea with the example code).

2) The form submits the textarea data in Firefox by passing the value to a hidden field.

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Editor Demo</title>
    <style type="text/css">
        @import "/mydojopath/dijit/themes/tundra/tundra.css";
        @import "/mydojopath/dojo/resources/dojo.css"
    </style>
    <script type="text/javascript" src="/mydojopath/dojo/dojo.js"
        djConfig="parseOnLoad: true">
</script>
        <script type="text/javascript">
       dojo.require("dojo.parser");
       dojo.require("dijit.Editor");
     </script>
</head>
<body class="tundra">
<form action="myscript.php" method="post">
<input type="hidden" name="story2" value="">
<textarea id="story" name="story" width="400px" height="120px" dojoType="dijit.Editor" styleSheets="/dojo-13/dojo/resources/dojo.css">
        It was a dark and stormy night.  Your story belongs here!
</textarea>
<input type="submit" value="Save" onclick="this.form.story2.value = dijit.byId('story').getValue();" />
</form>
</body>

Keyboard shortcuts

Do all of the options in the rich text editor have keyboard shortcuts associated with them? If so, how do I find out what they are?

The documentation doesn't mention this...

The plugin names are case-sensitive, so 'hilitecolor' as is printed above, didn't work for me, i checked the code for it and it wants it to be 'hiliteColor'. Hope that helps someone. Same for 'forecolor', 'foreColor'. Check the code for each one you use if it doesn't load and you'll find what it really wants.

Buttons work, but no button images?

Hi,
I have this installed, and the editor shows up but there are no images for the buttons. Just CSS blocks, when I click on them the editing functions work. I see the CSS references images relative from where the css is. Do I need to move them someplace else?

Same problem here..

Any solutions?

- Argui

You need the body class

eg: <body class="tundra"> as well as all the stylesheets.

Validation ? Make it required ?

Any way to make this form element "required" and have it trigger an invalidMessage call if nothing is entered ?

i.e. like validationTextBox ?

required="true"
invalidMessage="Please enter a value.">

LTR issue (left to right)

I tried using DoJo editor in a RTL mode and the screen get lost and show blank screen in IE 6, if you scroll all the way back to the right you see the screen again.

capture key pressed

I want to capture pressed key and print charCode to the debug console. This code behaves differently in Firefox 3.0.1 and IE7.0. If I type "a", debug console will output 97 in Firefox, and 65 97 in IE. Please help. I use dojo v1.1.1.

function echo(event) {
        key = event.charCode;
        console.debug(event.charCode);
        }

And here is the editor declaration: ... div name="field" width="200px" id="editor" dojoType="dijit.Editor" onkeypress="echo" ...

Btw, what's the recommended way to know the position of the newly typed character (current cursor location), with respect with other characters in the editing area of the Editor

Same problem here

At the moment we are facing the same problem how to know the position of the newly typed character. Do you found a solution how to determine the position?

Insert Images

This looks awesome, but we have a requirement for a WYSIWYG with image insertion. Is this on the roadmap?

Thanks

Will

Multi line break not supported??

Hi, does anyone facing this problem? When using the Enter key to enter line break, we can see the line breaks were entered for every Enter key we pressed. However, after i save the content, all the line breaks disappeared any on left single line break.

hii how to post the value of

hii

how to post the value of editor ????

Prbolem in IE while Dynamic creating Editor

Hi
Want to create Dijit Editor on click of a link. below is code, its works fine in Mozilla but its thows exception in IE.
Error : Expected identifier , string or number

this error is coming for line and char 33:
var myeditor = new dijit.Editor({class: 'tundra'},document.getElementById('myeditor') );

Request if anyone can help me out.

Thanks
Subodh

--------------------------------------------CODE-----------------------------------------------------------
function createEditor()
{
var editorarrtibute= {class: 'tundra'};
var myeditor = new dijit.Editor({class: 'tundra'},document.getElementById('myeditor') );
dojo.connect(dojo.byId('myeditor'), 'onDisplayChanged',setPreviewtext);
document.getElementById("myeditor").style.display="";
}

Edit me

Hello World

---------------------------------------------------------------------------------------------------------------------