Solved

Detect if WYWIWYG editor loaded

Posted on 2013-10-25
8
234 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

Suggested Solutions

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer…
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…
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…
Suggested Courses

734 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