CKEditor – Adding Content – $FC()

I wanted to be able to insert content into a CKEditor instance and on top of that, I wanted to concatenate with any existing content. Since I just had a little trouble figuring this out, so I decided to post it here for others to see.

The Solution

Because we use PrototypeJS, we have a helper function that allows us to get the value (only, no set) of an HTML element using the element ID:

So we wrote a helper function that does both get and set content of the CKEditor instance with one function:

If $sValue not set to null, the instance is updated, but either way, the current value is returned.

To make this all work together:

I love it when code is easy and just works!