How do I make the following code cross-browser compatible IE/Firefox, Mozilla?
if(FCKeditorAPI.GetInstance("editorname").GetXHTML() == '') {alert('content is empty')}
it works in internet explorer only...
Would very much appreciate someone's help on this.
if(FCKeditorAPI.GetInstance("editorname").GetXHTML() == '') {alert('content is empty')}
it works in internet explorer only...
Would very much appreciate someone's help on this.
RE: Making this code cross-browser
<input type="button" name="isEmpty" value="Is It Empty?" onClick="javascript:if(FCKeditorAPI.GetInstance('textEditor').GetXHTML() == ''){alert('content is empty')}else{alert('Not empty')};">
Worked for me. Basically the same code, just added an "not empty" bit.
But it works fine in both. Maybe you're not really empty? Or you could always try posting something more helpful than "it don't work" like "This si the error I got" maybe?
HTH and Good Luck!
-ps you did put the real instance name in the 'editorname' part, right? Just guessing, you'd prolly seen an error in both if not...
RE: Making this code cross-browser
Well actually I didn't realize first that I had put in GETHTML instead of GETXHTML in my code..that's why it wasn't working with Firefox but now everything is fine

Thanks for your help though!