Search code examples
javascriptmootoolswysiwygwmd

mooWMD is Undefined?


First off here is the code!

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <link href="content/wmd.css" rel="stylesheet" type="text/css" />
    <title>some title </title>
</head>
<body>
    <div class="main">
        <form>
            <h2>Only teaxt area</h2>
            <div id="wmd-editor-uno" class="wmd-panel">
                <div id="wmd-button-bar-uno" class='wmd-button-bar'></div>
                <textarea name='id-uno' id='id-uno'></textarea>
            </div>
        </form>
    </div>
    <script type='text/javascript' src="Scripts/mootools-yui-compressed.js"></script>
    <script type='text/javascript' src="Scripts/moowmd.js"></script>
    <script type="text/javascript">
        var MyConfig = [
        {
            input: 'id-uno',
            postfix: '-uno'
         }];
         window.addEvent('domready', function() {
             window.MyMooWMD = new mooWMD.WMD(window.MyConfig);
             window.MyMooWMD.start();
         });
    </script>
</body>
</html>  

Bam!

My problem is this, it doesn't work like the example at mooWMD tutorial all I get is an empty text area with the wmd.css style applied to it. I cant figure out what I could be doing wrong. All the file locations are correct but i get 'mooWMD' is undefined. I am at a loss any and all suggestions are appreciated.


Solution

  • The problem (for later generations) is IE does not accepts the following syntax:

    {
       att1: 'value',
       att2: 'value'
    }
    

    Where other browsers do. I changed it to

    {
       'att1': 'value',
       'att2': 'value'
    }
    

    And it is fine now. (using the mailing list would have gotten my attention earlier)