htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 3 (beta): htmlArea 2 & 3 archive (read only): htmlArea v3.0 - Discussion:
Cant get rid of error


The htmlArea 2 & 3 editors have been discontinued.

We've made these forums available as a read-only reference and knowledge-base for people using or developing editors based on htmlArea 2 or 3.

Anyone who is interested in taking over version 2 or 3 is free to do so. All we ask is that you choose a new name that doesn't have "htmlarea" in it to avoid confusion with this site. We'll even give you a link in the directory to make it easier for people to find you. If you are developing or hosting an htmlArea based-editor under a new name, please submit it to our directory.

 


bugsbunny29
New User

Jan 10, 2005, 7:09 AM

Post #1 of 2 (3290 views)
Shortcut
Cant get rid of error Can't Post

Im using a page with 2 html areas on and I keep getting the offsetWidth is null or not an object error. Now I have read through the forums and most of the posts said that it had something to do with being nested in tables. I have now removed all of the tables so its at the moment a basic page but im still getting the error and I cant work out why.

Ive come to the conclusion that ive done something wrong in the code below so is there anything major wrong with it that anyone can see. (in the text area i have tried both width=500px and width=100% and didnt change a thing)

<script type="text/javascript">
// the _editor_url is REQUIRED! don't forget to set it.
_editor_url = "/htmlarea/";
// implicit language will be "en", but let's set it for brevity
_editor_lang = "en";
</script>
<script type="text/javascript" src="/htmlarea/htmlarea.js"></script>
<script type="text/javascript">

HTMLArea.loadPlugin("SpellChecker");


// this function will get called at body.onload
function initDocument() {

// cache these values as we need to pass it for both editors
var css_plugin_args = {
combos : [
{ label: "Syntax",
// menu text // CSS class
options: { "None" : "",
"Code" : "code",
"String" : "string",
"Comment" : "comment",
"Variable name" : "variable-name",
"Type" : "type",
"Reference" : "reference",
"Preprocessor" : "preprocessor",
"Keyword" : "keyword",
"Function name" : "function-name",
"Html tag" : "html-tag",
"Html italic" : "html-helper-italic",
"Warning" : "warning",
"Html bold" : "html-helper-bold"
},
context: "pre"
},
{ label: "Info",
options: { "None" : "",
"Quote" : "quote",
"Highlight" : "highlight",
"Deprecated" : "deprecated"
}
}
]
};

var editor1 = new HTMLArea("main_article");

editor1.registerPlugin(SpellChecker);
editor1.config.toolbar = [
[ "fontname", "space",
"fontsize", "space",
"formatblock", "space", "SC-spell-check" ],

[ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
"insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
"forecolor", "hilitecolor", "separator",
"inserthorizontalrule", "createlink", "inserttable", "htmlmode", "popupeditor", "separator", "bold", "italic", "underline", "separator",
"strikethrough" ]
];


editor1.config.pageStyle =
'body { color: #2F2E76; font-family: verdana-sans-serif; a: } ' +
'A { color: #cccccc; text-decoration: none; font-weight: normal; font-family: verdana-sans-serif } ' +
'ul { font: 8pt verdana, sans-serif; color: #2F2E76; list-style-image: url(/page_images/li_arrow.gif) } ' +
'li { line-height: 11pt } ' +
'P {FONT: 8pt verdana, sans-serif; text-align: justify; color: #2F2E76; margin: 15px 0px 0px 0px } ' ;

editor1.generate();

var editor2 = new HTMLArea("preview");

editor2.registerPlugin(SpellChecker);
editor2.config.toolbar = [
[ "fontname", "space",
"fontsize", "space",
"formatblock", "space", "SC-spell-check" ],

[ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
"insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
"forecolor", "hilitecolor", "separator",
"inserthorizontalrule", "createlink", "inserttable", "htmlmode", "popupeditor", "separator", "bold", "italic", "underline", "separator",
"strikethrough" ]
];

editor2.config.pageStyle =
'body { color: #2F2E76; font-family: verdana-sans-serif; a: } ' +
'A { color: #cccccc; text-decoration: none; font-weight: normal; font-family: verdana-sans-serif } ' +
'ul { font: 8pt verdana, sans-serif; color: #2F2E76; list-style-image: url(/page_images/li_arrow.gif) } ' +
'li { line-height: 11pt } ' +
'P {FONT: 8pt verdana, sans-serif; text-align: justify; color: #2F2E76; margin: 15px 0px 0px 0px } ' ;

setTimeout(function() {
editor2.generate();
}, 500);
};
</script>

Cheers


sleemanj
User

Jan 10, 2005, 10:30 AM

Post #2 of 2 (3274 views)
Shortcut
Re: [bugsbunny29] Cant get rid of error [In reply to] Can't Post

Have you..

1. Tried stripping it down to the bare minimum, skip the plugins, styles etc. See if that works.
2. Tried in the other browser (you don't say which you are using).

What version of HTMLArea are you using? The CVS version, or my unofficial fork (link below) may include a fix for this.


James Sleeman
PHP Programmer

 
 
 


Search for (options)