We have a "browser test page" which is used to diagnose user problems. There are fields the user can fill out, plus quite a few detections as well. The data from that page can then be emailed into our tech support. The page is at http://www.rephunter.net/test-browser.php
. The current page is no longer fully functional, for the following reason:
I have just converted the website from using dojo to jquery. Part of the test includes checking for tinymce support. We used to run the "regular" tinymce library, but have switched over to the jquery version. In the previous version, which used an older version of TinyMCE, support was tested by the following:
if(typeof tinyMCE == 'undefined')
However, with the new instance of tinymce, it always comes up as undefined, even if there is a tinymce editor on the page. I have done some testing and it appears that tinyMCE is defined only after the form is submitted. For example, here is a snippet that shows how this works:
alert('head tinymce=' + typeof tinyMCE);
alert('validate tinymce=' + typeof tinyMCE);
alert('tinymce is defined');
<input type="submit" />
alert('body tinymce=' + typeof tinyMCE);
No matter what I have done in the detection program, the only way to get a valid tinyMCE object seems to be to submit the page. That is, the 'body' alert does not work; the "validate" alert does.
One workaround is to put on the page instructions for the user to look at the page and see if there is an editor rather than just a textarea. However, with our users this would be less than ideal. We really want the email, and thus I need to have a way to detect tinyMCE.
I may be able to work this out by having an onsubmit function that detects tinymce, but I would also like something that can be displayed directly to the user on first display of the page.
Is there a simple solution? Something similar to the elegance of if(typeof tinyMCE == 'undefined')