Given I have loaded the following HTML page, and all external resources are present:
I should be able to run this in a javascript console:
..and have the value of the textarea returned.
Instead, I am told by the js console (firebug) that:
'body is not defined'
Is it not possible to use square brackets in editor names?
If it is, how would I have to rewrite the above?
<!DOCTYPE html>
<html>
<head>
<script src='ckeditor/ckeditor.js' type='text/javascript'></script>
<script src='js/application.js' type='text/javascript'></script>
<title>Newswrap</title>
</head>
<body>
<form action='' method='post' name='dirty_text'>
<textarea cols='80' id='dirty_text[body]' name='dirty_text[body]' rows='10'>
Some text
</textarea>
<script type='text/javascript'>
//<![CDATA[
CKEDITOR.replace( 'dirty_text[body]',
{
fullPage : true,
toolbar : 'Basic'
});
//]]>
</script>
</form>
</body>
</html>
I should be able to run this in a javascript console:
CKEDITOR.instances.dirty_text[body].getData();
..and have the value of the textarea returned.
Instead, I am told by the js console (firebug) that:
'body is not defined'
Is it not possible to use square brackets in editor names?
If it is, how would I have to rewrite the above?

Re: instance names with square brackets fail on getData
for ( var i in CKEDITOR.instances ){ var currentInstance = i; break; } var oEditor = CKEDITOR.instances[currentInstance]; oEditor.getData();Not very clean, though.
Any ideas? Feel like I'm missing something obvious here.
Re: Can't reference instance names containing square bracket
That can't be the right way to go about it. Or?
Re: Can't reference instance names containing square bracket
It's just javascript syntax.