I'm using SCEditor and am loading it as such:
$(document).ready(function() {
// Create var to store emoticons
var emoticons = false;
$.getJSON('../../images/emoticons/default/emoticons.json')
.done(function(response) {
emoticons = response;
})
.always(function() {
// always initialize sceditor
$(".sceditor").sceditor({
// Options here...
});
});
})
Now, I'm wondering how I go about getting the instance
of this plugin so I can later pass it in if I want to reference it via a user action on the page.
For example, they have an API of which, what I would like to do is be able to get the value of the editor when the user clicks a preview button, it appears you can do that with this method.
My problem is, I'm not sure how I go about referencing the instance created?
I know how I could get it if I was running the code on the same request of when it was created, but not afterwards via a user action.
This is how you get the instance of a specific editor:
Then you get the current value, possibly filtered by plugins, like so:
If you want the rendered HTML value, do this: