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 fails to load properly


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.

 


laurenttkm
New User

May 20, 2004, 5:54 AM

Post #1 of 13 (38060 views)
Shortcut
htmlArea fails to load properly Can't Post

I'm having this problem occasionally where the htmlArea in my page fails to fully load up. It only displays the toolbar without the iframe. It happens a few times previously in htmlArea version 2 but now it seems to happen quite a lot of time in version 3. Each time this problem appears, I would need to click the "Refresh" or ctrl+F5 button to load the htmlArea properly. Appreciate it if anyone can help me with this? Thanks Laurent


akaEdge
Novice

Jan 13, 2005, 2:26 AM

Post #2 of 13 (37874 views)
Shortcut
Re: [laurenttkm] htmlArea fails to load properly [In reply to] Can't Post

I have this problem too - but only in IE - the toolbar is there and not the htmlarea - refreshing fixes it.

It is like the display property on the iframe is not turned on - when I click the <> (Toggle HTML Source) *that* appears and disappears.

This only happens when I have just turned my machine on and am looking at a page with htmlarea on it for the first time. All other times it seems to work. Closing and re-opening the browser does not cause it to happen though, so its very hard to debug!

I tried adding META tags to my header and also setting the defer a bit higher for the replacement...

<script type="text/javascript" defer="2">
HTMLArea.replace("problem_text", site_config);
</script>

I am using IE 6.02


Fyrespray
Novice

Jan 17, 2005, 11:41 PM

Post #3 of 13 (37812 views)
Shortcut
Re: [akaEdge] htmlArea fails to load properly [In reply to] Can't Post

I get the same thing with IE6 and so do all the people using the site I wrote. It all works fine in Firefox and netscape, its just IE6 that causes the problem.

It only seems to occur when I pre-populate the textarea with data. If I load up a new blank textarea it all works fine. Reloading the page will not fix it no matter how long a delay I put in only refreshing the page.

I tried writing some code that checked to see if the browser was IE and reloaded the page once if it was but it has not worked. I'll probable have a gor using a meta refresh later and will post back if it works.

Fyrespray
---------------------------------------------
http://www.lazeryattack.com
http://www.ardescosolutions.com


Fyrespray
Novice

Jan 18, 2005, 2:46 PM

Post #4 of 13 (37771 views)
Shortcut
Re: [Fyrespray] htmlArea fails to load properly [In reply to] Can't Post

Here's the quick fix I made for this problem using PHP. I'm sure there are probably neater ways to do it but it works and will do for now.

Place this between your <head></head> tags

<?
if (isset($_GET['IENeedFix'])=='TRUE')
{
$RedirectURLArray[0]=$_SERVER['PHP_SELF'];
$RedirectURLArray[1]="?";
$ManipulateQueryString=$_SERVER['QUERY_STRING'];
$WhereStartStrip=strpos($ManipulateQueryString, "&IENeedFix=TRUE");
$ManipulateQueryString=substr_replace($ManipulateQueryString, '', $WhereStartStrip, 15);
$RedirectURLArray[2]=$ManipulateQueryString;
$RedirectURL=implode("",$RedirectURLArray);
?>
<META HTTP-EQUIV=Refresh CONTENT='1 URL=<? echo($RedirectURL); ?>'>
<?
}

and use this bit of code to add the flag to trigger the above bit of code into your link that directs you to the htmlarea populated with data (i'm using a button to submit a form to populate the htmlarea with data so this is data submitted with a form and would be between <form></form> tags)

<?
//Check to see if Browser is MSIE
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE'))
{
if (!(strpos($_SERVER['HTTP_USER_AGENT'], 'Opera')))
{
?>
<input type="hidden" name="IENeedFix" value="TRUE">
<?
}
}
?>

Hope it will help some people.

Fyrespray
---------------------------------------------
http://www.lazeryattack.com
http://www.ardescosolutions.com

(This post was edited by Fyrespray on Jan 18, 2005, 3:15 PM)


Hipikat
User

Jan 18, 2005, 10:10 PM

Post #5 of 13 (37760 views)
Shortcut
Re: [laurenttkm] htmlArea fails to load properly [In reply to] Can't Post

I solved this problem by putting the following at the end of the function attached to editor.onGenerate:


Code
setTimeout( function() { if ( navigator.product == "Gecko" ) { editor._doc.designMode = "on"; } }, 150 );


However, I noticed it was still happening for larger content, but the following:


Code
setTimeout( function() { if ( navigator.product == "Gecko" ) { editor._doc.designMode = "on"; } }, 1000 );


fixed it. Ideally of course this would be attached to the onload of the body in the iframe (instead of benig a setTimeout), but I haven't gotten as far as successfully finding where that body does exist but hasn't loaded.


mrnetfellow
Novice

Jan 19, 2005, 11:37 AM

Post #6 of 13 (37719 views)
Shortcut
Re: [Hipikat] htmlArea fails to load properly [In reply to] Can't Post

Can you tell me where in which file you added this line? I'm having the same problem recently and would love to get it resolved.


Hipikat
User

Jan 19, 2005, 6:32 PM

Post #7 of 13 (37701 views)
Shortcut
Re: [mrnetfellow] htmlArea fails to load properly [In reply to] Can't Post

In the file you're loading htmlArea from, you should find the line

Code
editor.generate();

Before that, make a line like

Code
editor.onGenerate = onHAGenerated;

and then, back in the script's global scope, create that function, with the setTimeout line in it, e.g.

Code
function onHAGenerated() { 
setTimeout( function() { if ( navigator.product == "Gecko" ) { editor._doc.designMode = "on"; } }, 1000 );
}

But make sure you don't already have an editor.onGenerate function somewhere else, doing something important :)


mrnetfellow
Novice

Jan 19, 2005, 7:23 PM

Post #8 of 13 (37696 views)
Shortcut
Re: [Hipikat] htmlArea fails to load properly [In reply to] Can't Post

I've looked through my code, and I don't have editor.generate(); anywhere. On the page I load htmlArea from, I have:


Code
 <script type="text/javascript"> 
_editor_url = "/admin/tools/htmlarea/";
_editor_lang = "en";
</script>
<script type="text/javascript" src="/admin/tools/htmlarea/htmlarea.js"></script>
<script type="text/javascript" src="/admin/tools/htmlarea/dialog.js"></script>
<script tyle="text/javascript" src="/admin/tools/htmlarea/lang/en.js"></script>



I then have my default configuration, and to load HTMLArea, I use:


Code
 <script type="text/javascript" defer="1"> 

To load one with a configuration, do as follows
HTMLArea.replace('textboxid', configname);
</script>



I also did a search of the source code of all my HTMLArea files, and did not find a reference to edior.generate(); in any of them. Am I missing something?


Hipikat
User

Jan 19, 2005, 7:54 PM

Post #9 of 13 (37694 views)
Shortcut
Re: [mrnetfellow] htmlArea fails to load properly [In reply to] Can't Post

No, I'm just being naive about how htmlArea's instantiated as I haven't looked at it in a while. Um. replace() is just:

Code
HTMLArea.replace = function(id, config) { 
var ta = HTMLArea.getElementById("textarea", id);
return ta ? (new HTMLArea(ta, config)).generate() : null;
};

so, without trying it, I'm guessing you could replace your

Code
HTMLArea.replace('textboxid', configname);

with

Code
var editor = new HTMLArea('textboxid',configname); 
editor.onGenerate = yourOnLoadFunction;
editor.generate();

Hope that actually works for you =)


mrnetfellow
Novice

Jan 20, 2005, 4:30 AM

Post #10 of 13 (37678 views)
Shortcut
Re: [Hipikat] htmlArea fails to load properly [In reply to] Can't Post

Hmm. No good. Got the code updated, and no javascript errors, but the same problem of the textarea loading up in IE with the HTMLArea toolbar and path bar, but no main editor box. The weird thing is that it happens about 80% of the time, but the other 20% it loads fine.


Fyrespray
Novice

Feb 16, 2005, 6:06 AM

Post #11 of 13 (37192 views)
Shortcut
Re: [mrnetfellow] htmlArea fails to load properly [In reply to] Can't Post

Anybody come up with a neat way to fix this in javascript yet?

Fyrespray
---------------------------------------------
http://www.lazeryattack.com
http://www.ardescosolutions.com


mrnetfellow
Novice

Feb 16, 2005, 6:08 AM

Post #12 of 13 (37189 views)
Shortcut
Re: [Fyrespray] htmlArea fails to load properly [In reply to] Can't Post

I actually found that moving the section that loads the javascript for the textarea to the bottom of my page and out of a table fixed it. For some reason being within a table was causing the problem since the IE update.


Fyrespray
Novice

Feb 16, 2005, 8:03 AM

Post #13 of 13 (37179 views)
Shortcut
Re: [mrnetfellow] htmlArea fails to load properly [In reply to] Can't Post

Just had a look at a few other posts in the forums and found a nice easy way to do it. What I currently have pasted below:


Code
<head> 
<style type="text/css">@import url(htmlarea.css);</style>
<script type="text/javascript">
_editor_url = "/htmlarea/";
_editor_lang = "en";
</script>
<script type="text/javascript" src="/htmlarea/htmlarea.js"></script>
<script type="text/javascript">
var editor = null;
function initEditor() {
editor = new HTMLArea.replaceAll();
editor.generate();
return false;
};
</script>
</head>
<body onload="HTMLArea.init(); HTMLArea.onload = initEditor">


Thanks to Kayn for his post here http://www.htmlarea.com/forum/htmlArea_3_(beta)_C4/htmlArea_v3.0_-_Discussion_F14/How_to_replace_ALL_textareas_on_one_page_using_the_new_HTMLArea_RC_3_P38143/

Fyrespray
---------------------------------------------
http://www.lazeryattack.com
http://www.ardescosolutions.com

 
 
 


Search for (options)