htmlArea

A directory of browser-based WYSIWYG editors

  MAIN
INDEX
SEARCH
POSTS
WHO'S
ONLINE
LOG
IN

Home: htmlArea 2: htmlArea 2 & 3 archive (read only): htmlArea v2.0:
'document.all[...]' is null or is not an object


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.

 


tethered
New User

Mar 4, 2004, 10:31 AM

Post #1 of 16 (6605 views)
Shortcut
'document.all[...]' is null or is not an object Can't Post

'lo,

I'm working on a small content management system for a website, and htmlArea is a perfect little WYSIWYG editor for my purposes. I downloaded it, the installation went w/o a hitch and all works well, except every 3rd time I load the page which contains the htmlArea textarea field, it fails to load properly and IE (ver. 6.0.2800.1100) reports the following error:

'document.all[..]' is null or is not an object

If anyone has any experience with this and could offer their advice, it would be greatly appreciated.

Thanks,

Chuck


tethered
New User

Mar 4, 2004, 10:42 AM

Post #2 of 16 (6591 views)
Shortcut
Re: [tethered] 'document.all[...]' is null or is not an object [In reply to] Can't Post

In case it might help, I should mention... I originally installed htmlArea 3 beta, had the same problem, and decided to scrap that and go w/ htmlArea 2, hoping that that would resolve any stability issues. And when I say every 3rd time, that's just the general rule of thumb. Sometimes it loads fine 5 times in a row. Sometimes it won't load properly 5 times in a row. Its off and on and very strange. Almost as if there's a problem w/ data being corrupted as it downloads from the server or something.

Gah...


electric
New User

Jun 10, 2004, 9:26 PM

Post #3 of 16 (6201 views)
Shortcut
Re: [tethered] 'document.all[...]' is null or is not an object [In reply to] Can't Post


In Reply To
... every 3rd time I load the page which contains the htmlArea textarea field, it fails to load properly and IE reports the following error:

'document.all[..]' is null or is not an object

If anyone has any experience with this and could offer their advice, it would be greatly appreciated.



Did you ever receive a reply or determine a fix for this problem? I am getting exactly the same error... once I make an update with htmlarea, I am unable to go back and "reload" it into the editor without this popup error appearing.

Any ideas?


ehuang70
New User

Aug 18, 2004, 4:00 PM

Post #4 of 16 (5825 views)
Shortcut
Re: [tethered] 'document.all[...]' is null or is not an object [In reply to] Can't Post

I experienced the same error and am looking for a fix too. I would appreciate any help.


Timothy
New User

Aug 22, 2004, 2:09 PM

Post #5 of 16 (5788 views)
Shortcut
Re: [ehuang70] 'document.all[...]' is null or is not an object [In reply to] Can't Post

Hi there,

I had the same issue. I think is an Internet Explorer caching problem.

I solved it by forcing IE to reload every page. Go to Tools - Internet Options - Temporary Internet files - Settings and set it to "Every visit to the page".

If that doesn't work for you, there are 2 other options:

1.) enter the full address for editor.js, e. g. "http://somewhere.com/editor.jsp", not "editor.jsp". As far as I know IE doesn't cache these objects, but I am not sure.

2.) Use a timestamp as a parameter when you include editor.js.

This is the basic code for including editor.js:


Code
<script language="Javascript1.2"><!-- // load htmlarea 
_editor_url = ""; // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera') >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
document.write(' language="Javascript1.2"></scr' + 'ipt>');
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// --></script>


Replace that with following code:


Code
<script language="Javascript1.2"><!-- // load htmlarea 
_editor_url = ""; // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
var timestamp = new Date();
if (navigator.userAgent.indexOf('Mac') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera') >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js?"' + timestamp.getTime());
document.write(' language="Javascript1.2"></scr' + 'ipt>');
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// --></script>


I haven't tested it because I use serverside scripts to add a timestamp... but I think it should work. I used this trick one time before and IE downloaded the file each time again.

Adding Meta Tags like

Code
<meta http-equiv="expires" content="0"> 
<meta http-equiv="cache-control" content="no-cache">


doesn't help... tried it with no success.

Let me know if this works for you..

Regards,
Timothy


ukwebguy
New User

Aug 27, 2004, 6:53 AM

Post #6 of 16 (5664 views)
Shortcut
Re: [Timothy] 'document.all[...]' is null or is not an object [In reply to] Can't Post

OK - I think I may be able to add something to this. I too, had the same problem and worked through all the solutions -- META tags -- timestamps -- IE cache settings -- putting the script inside the table cell etc etc and still the problem ocurred. I then noticed (well, not exactly noticed - I did a char by char crawl through the code!) that the call to editor_generate('comment') did not match the name of the TEXTAREA, called 'content'. Surprisingly, the editor still works, possibly because there is only one TEXTAREA in the page, BUT, when I changed the name in the editor_generate() function to match the name of the TEXTAREA, the problem disappeared.

I really hope that I've hit the spot here, at least for some of you. Let me know

ukwebguy
-----------------------
Cobwebbery Web Design
http://www.cobwebbery.co.uk


JCollum
Novice

Oct 3, 2004, 11:37 PM

Post #7 of 16 (5210 views)
Shortcut
Re: [ukwebguy] 'document.all[...]' is null or is not an object [In reply to] Can't Post

Yeah, you hit it.

The call to editor_insertHTML takes two args (and a third as an overload). The first is the name of the textbox that the html needs to be inserted into. The second is the text itself.

In true Java style, the error has nothing to do with the actual exception. Wink

Here's the comment from the editor.js file:


/* ---------------------------------------------------------------------- *\

Function : editor_insertHTML

Description : insert string at current cursor position in editor. If

two strings are specifed, surround selected text with them.

Usage : editor_insertHTML(objname, str1, [str2], reqSelection)

Arguments : objname - ID of textarea

str1 - HTML or text to insert

str2 - HTML or text to insert (optional argument)

reqSelection - (1 or 0) give error if no text selected

\* ---------------------------------------------------------------------- */



nazree
New User

Oct 4, 2004, 1:00 AM

Post #8 of 16 (5206 views)
Shortcut
Re: [ukwebguy] 'document.all[...]' is null or is not an object [In reply to] Can't Post

hi ukwebguy,

based on your solution, when you changed the name of the editor_generate() function, what exactly is being ammended ?

Let's say that I have a file called update.php and it has a form named formArticle which utilizes a textarea. At present, the function is called upon by

<script language="JavaScript1.2" defer>
editor_generate('frmArticle');
</script>

However, it still generates the javascript document.all[.] error..

I would be grateful to you if you could elaborate more on which function call has to be edited ?

Thanks


ukwebguy
New User

Oct 4, 2004, 1:50 AM

Post #9 of 16 (5197 views)
Shortcut
Re: [nazree] 'document.all[...]' is null or is not an object [In reply to] Can't Post

Nazree,

All I'm pointing out is that after setting the config (as in the default 'out-of-the-box' solution) the editor is generated using the call...

editor_generate('desc',config);

where the first argument is the name of the textarea to use. If the name in the function call does not match the name of the textarea, it will generate the "document.all[..]" is null error.

Hope this helps


nazree
New User

Oct 4, 2004, 3:11 AM

Post #10 of 16 (5193 views)
Shortcut
Re: [ukwebguy] 'document.all[...]' is null or is not an object [In reply to] Can't Post

Thank you for the prompt reply ukwebguy, appreciate it.

Anyway, I think i might have chanced upon the best way to resolve this issue.

=========================================================================

<script language="JavaScript1.2" defer>
editor_generate("txtAreaName");
</script>
=========================================================================

This block of code which calls the function has to be placed specifically after the textarea tags AND before the closing </FORM> tags

example:

<textarea name = txtAreaName .... etc etc</textarea>

<script language="JavaScript1.2" defer>
editor_generate("txtAreaName");
</script>


</FORM>

So far, I have no problems with the javascript error anymore ( document.all[..] ). Please try it out and test it. Should be working fine...



Cheers


omurolmez
New User

Oct 12, 2004, 10:04 PM

Post #11 of 16 (5043 views)
Shortcut
Re: [Timothy] seems IE script running order [In reply to] Can't Post

              Hello,

I tried forcing IE not to cache page. When it is done, the editor really works.

But, I think this is about IE's script running order.

I remove the last script block (the block, initializes the config object and calls the editor_generate function) and moved all the code to a body_OnLoad handler function. Now editor runs without any error.

In my opinion, IE starts running the last script block without completing parsing/loading the previous script blocks and the error occurs. But if we move the initialization code into body OnLoad handler, IE waits until finish parsing/loading all scripts prior to last.

Omur Olmez


elizbbw
New User

Oct 15, 2004, 11:43 PM

Post #12 of 16 (4957 views)
Shortcut
Re: [nazree] 'document.all[...]' is null or is not an object [In reply to] Can't Post

Thank you so much for posting this information. I just installed htmlArea tonight, and thanks to your post, my problem was fixed!

Elizabeth


ginger23
New User

Feb 6, 2005, 6:35 AM

Post #13 of 16 (4070 views)
Shortcut
Re: [nazree] 'document.all[...]' is null or is not an object [In reply to] Can't Post

Hi,

I used nazree's method of placing this code . . .

(<script language="JavaScript1.2" defer>
editor_generate("txtAreaName");
</script>)


... after the textarea tag, but before the closing form tag and it solved most of my problems with document.all error, but now I've noticed that if you click on the icon to Enlarge Editor, you get the document.all error and nothing shows up in the enlarged editor.

Does anyone know how to fix this?

Thanks a bunch for any suggestions!


nazree
New User

Feb 6, 2005, 6:44 AM

Post #14 of 16 (4061 views)
Shortcut
Re: [ginger23] 'document.all[...]' is null or is not an object [In reply to] Can't Post

Hello ginger23,

According to what you have described, I have no issues with it. I do not get the error that you are getting after clicking on the 'Enlarge Editor' button. Seems to be working fine and everything showed up.

I am running Windows 2000 with I.E 6.

Unfortunately, I do not have any suggestions on that. Just to highlight to you that with my system specifications, there was no javascript error. My apologies for not giving a clear cut solution.

G'day


ginger23
New User

Feb 6, 2005, 6:51 AM

Post #15 of 16 (4059 views)
Shortcut
Re: [nazree] 'document.all[...]' is null or is not an object [In reply to] Can't Post

Thanks nazree,

I was afraid you'd say that. It must have been something else I did then. I'll look into it further.


ginger23
New User

Feb 6, 2005, 7:04 AM

Post #16 of 16 (4055 views)
Shortcut
Re: [ginger23] 'document.all[...]' is null or is not an object [In reply to] Can't Post

Ok, I found it. I had made some changes when I was trying to correct the original document.all errors and I needed to go back and remove those changes because they weren't necessary. Moving the function below the textarea corrected the original errors.

 
 
 


Search for (options)