Solved

Detect if WYWIWYG editor loaded

Posted on 2013-10-25
8
233 Views
Last Modified: 2013-10-29
I am using (Imperavi) Redactor as a WYSIWYG editor.  It is not compatible with some browsers (for example, IE 8).  How do I detect whether or not the editor has loaded when I'm handling the data after the POST?
0
Comment
Question by:jeff_zucker
  • 4
  • 4
8 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39601796
Should be able to just do

if($.redactor) {
...
}

OR
if(jQuery().redactor) {
...
}


But I don't know the plugin so it may be wrong, but this is the standard way for plugins.
0
 

Author Comment

by:jeff_zucker
ID: 39607040
I tried that and it triggered regardless of whether the plugin actually loaded.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39607195
Does the plugin add classes to the elements, it may be easier to just do a check for .hasClass("classname").
The plugin may be getting initiated even tho it doesn't do anything. Do you have a live link to the page in question?
0
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 

Author Comment

by:jeff_zucker
ID: 39607433
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39607435
Not to the plugin - to your page.

Forget that just use conditional statements

<!--[if lt IE 9]>

add your js stuff or whatever here

<![endif]-->
0
 

Author Comment

by:jeff_zucker
ID: 39610491
I can't link to my page (privacy and other reasons).  

The conditional statement won't work because old IE browsers aren't the only one's that won't load the plugin.
0
 
LVL 58

Expert Comment

by:Gary
ID: 39610497
Then I think you need to rethink the plugin if there are so many browsers it doesn't work in.
Since its a paid for plugin I cannot really test it.
0
 

Author Closing Comment

by:jeff_zucker
ID: 39610696
Looks like there isn't a perfect solution.  However, 99% of the issues are going to come from IE 8 and older browsers, so this is the solution I will use.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question