Jquery conflict with WordPress Tinymce

I’m using WordPress TinyMCE editor inside admin page for my plugin.

<td id="content_update_editor"><?php the_editor('Write your content here..');?></td>

I also have some Ajax call and for that I need jquery to include.

Read More
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    <script type="text/javascript"> 

        function autopost_getContentData(itemId){

            // get base directory url
            var baseDir = $('#baseDir').val();

            // call to ajax script to get site data
            $.ajax( {
                type: "POST",
                url: baseDir + "/autopost_ajax_actions.php",
                data: "id=" + itemId + "&action=get_content_data",
                success: function(data) {
                    // somework
                }
            });
        }


    </script>

When jquery is added, Jquery works fine but the editor got trouble and it does not show the toolbar but when I remove the jquery code, the editor starts working? Any reason of this conflict?Thanks

Related posts

Leave a Reply

1 comment

  1. Jquery no conflict may solve your problem

    <script type="text/javascript" src="other_lib.js"></script>
    <script type="text/javascript" src="jquery.js"></script>
    <script type="text/javascript">
      $.noConflict();      
      // Code that uses other library's $ can follow here.
    </script>