views:

28

answers:

1

Why TinyMCE's getContent() returns empty string if content is several space?

If my content contain only spaces, then getContent() method return empty string.

I want count up chars in TinyMCE's body.

+1  A: 

Before TinyMCe returns the editors content this is called in Editor.js:

h = h.replace(/^\s*|\s*$/g, ''); // h is the content

This removes spaces at the beginning and end of your content, therefor your getContent() is empty when you only have spaces inserted.

Thariama