Note that there are some explanatory texts on larger screens.

plurals
  1. POjQuery + InnovaStudio WYSIWYG Editor
    primarykey
    data
    text
    <p>I am trying to avoid hard-coding each instance of this WYSIWYG editor so I am using jQuery to create an each() loop based on function name. Annoyingly InnovaStudio seems to explode when I try.</p> <p><a href="http://www.focalmedia.net/pseekmanual/weditor/documentation/default_start.htm" rel="nofollow noreferrer"><strong>Documentation</strong></a></p> <p><strong>Attempt #1</strong></p> <pre><code>&lt;script type="text/javascript"&gt; /* id = $(this).attr('id'); if(id.length == 0) { id = 'wysiwyg-' + wysiwyg_count; $(this).attr('id', id); } WYSIWYG[wysiwyg_count] = new InnovaEditor('WYSIWYG[' + wysiwyg_count + ']'); WYSIWYG[wysiwyg_count].REPLACE(id); */ var demo = new InnovaEditor('demo'); demo.REPLACE('wysiwyg-1'); console.log('loop'); &lt;/script&gt; </code></pre> <p><strong>Effect</strong></p> <p>Works fine, but of course only works for a single instance of the editor. If I want multiple instances I need to use an each.</p> <p><strong>Attempt #2:</strong></p> <pre><code>&lt;script type="text/javascript"&gt; var wysiwyg_count = 1; //var WYSIWYG = []; var demo; (function($) { $(function() { $('.wysiwyg-simple').each(function(){ /* id = $(this).attr('id'); if(id.length == 0) { id = 'wysiwyg-' + wysiwyg_count; $(this).attr('id', id); } WYSIWYG[wysiwyg_count] = new InnovaEditor('WYSIWYG[' + wysiwyg_count + ']'); WYSIWYG[wysiwyg_count].REPLACE(id); */ demo = new InnovaEditor('demo'); demo.REPLACE('wysiwyg-1'); console.log('loop'); }); }); })(jQuery); &lt;/script&gt; </code></pre> <p><strong>Effect</strong></p> <p>Replaces the entire HTML body of my page with JUST WYSIWYG related code and complains as no JS is available (not even Firebug, so can't debug).</p> <p>Notice that I am hardcoding the name still. I only have one instance on the page I am testing it on, so when I get this hard-coded name working I will get the commented out code working along the same lines.</p> <hr> <p>Does anybody know what the hell is going on here?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload