Solved

Detect if WYWIWYG editor loaded

Posted on 2013-10-25
8
231 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
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 

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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn how to dynamically set the form action using jQuery.
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…

861 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