CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript programming (http://www.codingforums.com/forumdisplay.php?f=2)
-   -   How to call custom method in this plugin example (http://www.codingforums.com/showthread.php?t=285285)

quadrant6 01-04-2013 08:37 PM

How to call custom method in this plugin example
 
I'm using the jQuery based WYSIWYG editor Redactor and in trying to follow along with their simple docs, how would you call the method 'your_method' in their example here?

http://imperavi.com/redactor/docs/creatingplugins/


They don't have an example. All I want to do is put a button on the page and then when that button is clicked, trigger off my own custom method.

I'm sure this is an easy one for any experience JS coder. Insight appreciated!

Redcoder 01-07-2013 12:41 PM

Give that initializer function a name and then call it:
PHP Code:

    <script type="text/javascript">
    $(
document).ready(
    function 
yourFunctionName()
    {
    $(
'#redactor').redactor({
    
plugins: ['fullscreen''advanced']
    });    
    }
    );
    
</script>

<button onClick="yourFunctionName()">CLICK ME TO INTIALIZE</button> 



All times are GMT +1. The time now is 01:15 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.