Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Aug 2002
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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!

  • #2
    Regular Coder Redcoder's Avatar
    Join Date
    May 2012
    Location
    /dev/null
    Posts
    333
    Thanks
    2
    Thanked 47 Times in 46 Posts
    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> 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •