Solved

Detect if WYWIWYG editor loaded

Posted on 2013-10-25
8
217 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
 

Author Comment

by:jeff_zucker
ID: 39607433
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

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…
There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
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…

747 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now