I've done a bit of googling to see if someone already knows the answer to this, but without luck. Please excuse me if this is a duplication.
I am using multiple instances of the FCKEditor on one page. An unlimited amount of them as the page is dynamic.
I'm loading all of these editors initially through php, using all the same variables save content and id.
I have everything working as I want. The editors work perfectly, as fully separate DOM elements and objects.
The only problem I have is that each instance of the editor does its own GET /fckeditor/fckstyles.xml.
The load time for each varies from 50-200ish ms per editor. Not big for 5 or so editors. But I don't control how many there will be.
The problem actually gets worse during DOM manipulation with javascript.
Watching Firebug's Console I see another GET /fckeditor/fckstyles.xml every time I move the editor's containing div.
It happens on both appendChild(), and insertBefore().
Here's a basic idea of the movements:
Does anyone know how to cache /fckeditor/fckstyles.xml and refer to it from then on?
Failing that, does anyone know how to stop DOM moves from recalling the styles?
If it's a built in option, I would prefer not to tear into your code.
On an odd note: Firefox will stall and hold scripts or make them run in staggered bursts while it loads the GETs. IE7 continues the scripts and calls does the GETs separately. It may not be right, but for a rarity, IE7 actually looks better than FF on this.
Thank you
I am using multiple instances of the FCKEditor on one page. An unlimited amount of them as the page is dynamic.
I'm loading all of these editors initially through php, using all the same variables save content and id.
I have everything working as I want. The editors work perfectly, as fully separate DOM elements and objects.
The only problem I have is that each instance of the editor does its own GET /fckeditor/fckstyles.xml.
The load time for each varies from 50-200ish ms per editor. Not big for 5 or so editors. But I don't control how many there will be.
The problem actually gets worse during DOM manipulation with javascript.
Watching Firebug's Console I see another GET /fckeditor/fckstyles.xml every time I move the editor's containing div.
It happens on both appendChild(), and insertBefore().
Here's a basic idea of the movements:
<div id="elements"> <div id="1" class="slideWrap"> <div class="row"> *editor* </div> </div> <div id="2" class="slideWrap"> <div class="row"> *editor* </div> </div> </div> document.getElementById("elements").appendChild(document.getElementById("1")); *GET /fckeditor/fckstyles.xml is fired*
Does anyone know how to cache /fckeditor/fckstyles.xml and refer to it from then on?
Failing that, does anyone know how to stop DOM moves from recalling the styles?
If it's a built in option, I would prefer not to tear into your code.
On an odd note: Firefox will stall and hold scripts or make them run in staggered bursts while it loads the GETs. IE7 continues the scripts and calls does the GETs separately. It may not be right, but for a rarity, IE7 actually looks better than FF on this.
Thank you
Re: DOM Move and multiple GET /fckeditor/fckstyles.xml
It's slightly more javascript, but the pay off becomes huge for each editor you risk preloading.
For those who can't get around this problem, load your editors on demand.
It still produces the lag and extra calls when moved, but it's far better this way.