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:
HTMLArea 3 Loading on Refresh 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.

 


mrnetfellow
Novice

Aug 15, 2003, 1:05 PM

Post #1 of 20 (12568 views)
Shortcut
HTMLArea 3 Loading on Refresh Error Can't Post

I am trying to make one self-contained file of all of the HTMLArea load commands that I can include in the head of any document I want to use HTMLArea in. So far this works, except for the following issue:

I can't use the <body onload=... tag, because this would be included in the head (and the page would have its own <body> tag below my include. So I use the following:

<script type="text/javascript" defer="1">
HTMLArea.replaceAll();
</script>

This works fine on page load initially, but if I hit refresh (IE6 and XP), it doesn't load HTMLArea, just a plain text box.

Any ideas? Maybe an alternate way to load HTMLArea.replaceAll();?


JSTijn
Novice

Jan 8, 2004, 3:30 AM

Post #2 of 20 (12420 views)
Shortcut
Re: [mrnetfellow] HTMLArea 3 Loading on Refresh Error [In reply to] Can't Post

I have problems too with refreshing. But only with the default HTMLArea.

I get the error:

Line:250
Char:3
'HTMLArea.l18N.tooltips' is null or not an object

The odd thing is that its not on all computers that i work on. I have the problem on 3 computers. But on 2 computers i do not have the problem. With Mozilla i don't have problems with the loading.

Mostly the error comes when i use ctrl+F5. I looks like the script isn't well read by IE and because of that the error comes.


flowinto
New User

Mar 4, 2004, 4:36 AM

Post #3 of 20 (12309 views)
Shortcut
Re: [JSTijn] HTMLArea 3 Loading on Refresh Error [In reply to] Can't Post

got the same problem....

"HTMLArea.I18N.tooltips is Neull or not an Object" when I refresh page.

useing WinXP IE 6.0

Please help!



Addy


Evervision
Novice

Mar 12, 2004, 5:04 PM

Post #4 of 20 (12237 views)
Shortcut
Re: [flowinto] HTMLArea 3 Loading on Refresh Error [In reply to] Can't Post

I have found a loading problem that is similar to this. After some digging, I found that since we are Dynamically loading the language file (where I18N is defined) it doesn't always exist. My specific problem was that plugins were loading before I18N was. I changed the loadPlugin function to use _editor_lang instead of I18N (should always be the same right?) and this solved my problem. This does seem to be a problem overall. IE seems to load javascripts in different threads, as well as different parts of the page as different threads (head seperate from body) and on event functions are also in seperate threads.

Anyway, this should give you a clue as to what could be the problem. The whole dynamic loading of scripts needs to be fixed so objects aren't used before there loaded.

Jason


emanresu
Novice

Apr 1, 2004, 6:04 PM

Post #5 of 20 (12129 views)
Shortcut
Re: [Evervision] HTMLArea 3 Loading on Refresh Error [In reply to] Can't Post

I have this same problem in I.E. 6.0 on Win2k. It does not just happen on refreshes for me. It happens by random anytime HTMLArea is loaded. I do not quite understand Jason's solutions. Can someone give line # for hacks or etc. for solutions for this problem? Thanks


Evervision
Novice

Apr 1, 2004, 6:13 PM

Post #6 of 20 (12126 views)
Shortcut
Re: [emanresu] HTMLArea 3 Loading on Refresh Error [In reply to] Can't Post

Specifically for the I18N not loaded, the changes are as follows:

Code
 // static function that loads the required plugin and lang file, based on the  
// language loaded already for HTMLArea. You better make sure that the plugin
// _has_ that language, otherwise shit might happen ;-)
HTMLArea.loadPlugin = function(pluginName) {
var dir = _editor_url + "plugins/" + pluginName;
var plugin = pluginName.replace(/([a-z])([A-Z])([a-z])/g,
function (str, l1, l2, l3) {
return l1 + "-" + l2.toLowerCase() + l3;
}).toLowerCase() + ".js";
var plugin_file = dir + "/" + plugin;
// CHANGES FOLLOW: original has 'HTMLArea.I18N.lang' instead of '_editor_lang'
var plugin_lang = dir + "/lang/" + _editor_lang + ".js";
// CHANGES END;
HTMLArea._scripts.push(plugin_file, plugin_lang);
document.write("<script type='text/javascript' src='" + plugin_file + "'></script>");
document.write("<script type='text/javascript' src='" + plugin_lang + "'></script>");
};

For other problems, most are solved if you put the _editor_lang and _editor_url as well as loading htmlarea.js and calling LoadPlugin in the header, and only do configurations and registering plugins in the body.

If you still are having problems, just post your error message and describe your setup.

Jason


(This post was edited by Evervision on Apr 1, 2004, 6:15 PM)


emanresu
Novice

Apr 1, 2004, 9:40 PM

Post #7 of 20 (12121 views)
Shortcut
Re: [Evervision] HTMLArea 3 Loading on Refresh Error [In reply to] Can't Post

Thanks, Jason.

I have updated my script. I will let you all know if I experience the problem again.


codemind
New User

Apr 30, 2004, 8:58 AM

Post #8 of 20 (11963 views)
Shortcut
Re: [flowinto] HTMLArea 3 Loading on Refresh Error [In reply to] Can't Post

The problem is in loading the language script. As a temporary solution I did this:

I commented the automatic loading of language script and loaded it in the head of my HTML page.

// load some scripts
(function() {
var scripts = HTMLArea._scripts = [ _editor_url + "htmlarea.js",
_editor_url + "dialog.js",
_editor_url + "popupwin.js"];
//CHANGED BY CODEMIND !!!!!!!!!!!
//_editor_url + "lang/" + _editor_lang + ".js" ];
//END CHANGE
var head = document.getElementsByTagName("head")[0];
// start from 1, htmlarea.js is already loaded
for (var i = 1; i < scripts.length; ++i) {
var script = document.createElement("script");
script.src = scripts;
head.appendChild(script);
}
})();

<script type="text/javascript">
_editor_url = "/htmlarea/";
_editor_lang = "en";
</script>
<script type="text/javascript" src="/htmlarea/htmlarea.js"></script>
<script type="text/javascript" src="/htmlarea/lang/en.js"></script>

I'm looking at a beter work arround but for the moment this works fine.


Rim
New User

Sep 9, 2004, 9:54 AM

Post #9 of 20 (11491 views)
Shortcut
Re: [Evervision] HTMLArea 3 Loading on Refresh Error [In reply to] Can't Post

I added some extra checks to provide a workaround for the I18N.Tooltips is null problem. On line 246 of HTMLArea.js is the start of the loop that gives the error. Replacing this loop with the following code solved the problem, at least for me.


Code
 
for (var i in this.btnList) {
var btn = this.btnList;
btn[1] = _editor_url + this.imgURL + btn[1];

if (HTMLArea.I18N.tooltips != null) {
if (HTMLArea.I18N.tooltips != null) {
if (typeof HTMLArea.I18N.tooltips != "undefined") {
btn[0] = HTMLArea.I18N.tooltips;
}
}
}
}



Basty
New User

Sep 10, 2004, 5:45 AM

Post #10 of 20 (11469 views)
Shortcut
Re: [Rim] HTMLArea 3 Loading on Refresh Error [In reply to] Can't Post

Hoi!

Been having this problem as well, and changed the above example a bit, to avoid editing your htmlarea.js - I found out, that this works :



Code
<body onload="onLoadFkt()"> 


<script type="text/javascript">
function onLoadFkt()
{
_editor_url = "/*your URL*/";
_editor_lang = "en";

// Checks, if Tooltip thingie is null and waits, till it's loaded...
if (HTMLArea == null || HTMLArea.I18N == null || HTMLArea.I18N.tooltips == null)
{
setTimeout("onLoadFkt()",50);
}
else
{
var config = new HTMLArea.Config();
HTMLArea.replaceAll(config);
}
}
</script>


Aktually, this script makes your browser wait, till the script is loaded. Just dump it into your file, that uses HTMLarea.

Bye,
Basty


FragMented
New User

Sep 13, 2004, 4:52 AM

Post #11 of 20 (11431 views)
Shortcut
Re: [Basty] HTMLArea 3 Loading on Refresh Error [In reply to] Can't Post

You may want to call clearTimeout() when it loads successfully.

Otherwise that method will be probed every 50 ms Shocked. Probably not noticable, but you may want to fix.


Basty
New User

Sep 13, 2004, 5:08 AM

Post #12 of 20 (11429 views)
Shortcut
Re: [FragMented] HTMLArea 3 Loading on Refresh Error [In reply to] Can't Post

Hoi FragMented!

IMHO, the function does no longer get called, once the htmlarea is properly loaded - why do you think clearTimeout() should be called?

Does this function repeat, until it's cleared? I thought it would just be a one-time thing ( that calls itself, when the if clause is fulfilled, but not again, when it's no longer.. ).

Just FYI, I'm rather new to this, so don't take this as a flame, but rather as a request for clarification. Thanks.

Bye,
Basty


FragMented
New User

Sep 13, 2004, 5:34 AM

Post #13 of 20 (11426 views)
Shortcut
Re: [Basty] HTMLArea 3 Loading on Refresh Error [In reply to] Can't Post

My apologies. I just tested it, and its only called once.

I also wasnt too sure on how setTimeout() worked. I was under the assumption it would call the associated function until clearTimeout() was called.


Ecco
Novice

Oct 22, 2004, 2:40 AM

Post #14 of 20 (11257 views)
Shortcut
Re: [Basty] HTMLArea 3 Loading on Refresh Error [In reply to] Can't Post

Yes, this is the solution for my (random) loading problems. HtmlArea loaded just fine in about 20 refreshes which is unprecedented. Many thanks, but..... Wink

Now I can't load any plugins anymore. Do you think you could squeeze them in somewhere too?

Cheerio,

Ecco


JCollum
Novice

Nov 3, 2004, 9:04 AM

Post #15 of 20 (11106 views)
Shortcut
Re: [Ecco] HTMLArea 3 Loading on Refresh Error [In reply to] Can't Post

I tried the onLoadFkt() function and found that it was infinite. The I18N stuff never loads.


Ecco
Novice

Nov 3, 2004, 9:54 AM

Post #16 of 20 (11095 views)
Shortcut
Re: [Ecco] HTMLArea 3 Loading on Refresh Error [In reply to] Can't Post

I seemed to have solved my plugin-problem. I'll show you what I did but don't ask me what this does or means.

I start HtmlArea as usual, and then :


Code
 <body onload="initEditor(); onLoadFkt();">  

<script type="text/javascript">
function onLoadFkt()

{
_editor_url = "/htmlarea/";
_editor_lang = "nl";

if (HTMLArea == null || HTMLArea.I18N == null || HTMLArea.I18N.tooltips == null)
{
setTimeout("onLoadFkt()",50);
}

else
{
//var config = new HTMLArea.Config();
//HTMLArea.replaceAll(config);
}
}
</script>



gbooman
New User

Dec 13, 2004, 7:49 PM

Post #17 of 20 (10609 views)
Shortcut
Re: [Ecco] HTMLArea 3 Loading on Refresh Error [In reply to] Can't Post

It appears that the null tooltips problem is due to the language files not being loaded (or not yet loaded at the point of reference.)

The most recent version of htmlarea.js has a rewritten loadScript() function. The scripts don't get loaded until HTMLArea.init() is called. I can't seem to find any such call. Anyone have any ideas? If I put an explicit call in around line 97 after the 3rd loadscript call, it works great.
Gordon Booman


Aultako
New User

Dec 14, 2004, 3:27 AM

Post #18 of 20 (10587 views)
Shortcut
Re: [gbooman] HTMLArea 3 Loading on Refresh Error [In reply to] Can't Post

For what it's worth, going back through the CVS... I encountered this problem beginning with 1.83 of htmlarea.js. When replaced with 1.82, the error goes away.

I also get the problem if I load the latest en.js (regardless of htmlarea.js version). Reverting to en.js-rc1 clears the problem (as long as htmlarea.js < 1.83).

As a newbie, there are seven kinds of things I may be doing wrong, but I get the error in Firefox (0.91) and IE (6.0.2) on any kind of load. (Still trying to get onLoadFkt() to work for me.)

(This post was edited by Aultako on Dec 14, 2004, 4:59 AM)


SFADuncan
Novice

Jan 25, 2005, 6:39 AM

Post #19 of 20 (10134 views)
Shortcut
Re: [Aultako] HTMLArea 3 Loading on Refresh Error [In reply to] Can't Post

   

I am convinced that the answer to my dreams lies somewhere in the above threads / discussions (ie erratic loading in version 3, which i desparately require for the cut n paste feature)

However, I am a PHP man, and not at all literate in Javascript... so could some kind soul please inform me of the following:

- what version to use? V3 RC1 or RC2 or RC2b?

- what exact new code should I type?

- is it replacement code or additional?

- where does it go? in htmlarea.js? in <head> or <body>

You would be making this mediocre plodder very happy should the above be provided, and I'd promise to go and do my penance in the HTML and PHP forums!

Thanks

Simon


johnmark
New User

Jan 26, 2005, 4:37 PM

Post #20 of 20 (10058 views)
Shortcut
Re: [JSTijn] HTMLArea 3 Loading on Refresh Error [In reply to] Can't Post

for RC 2 - I actually uncommented the following lines (Which are commented of course in htmlarea.js)
And everything started working:



Code
document.write("<script type='text/javascript' src='" + plugin_file + "'></script>"); 
document.write("<script type='text/javascript' src='" + plugin_lang + "'></script>");


 
 
 


Search for (options)