问题
I have added these file in my plugin .
function fullcalendar(){
wp_enqueue_style( 'full-css', 'http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.2.3/fullcalendar.min.css' );
wp_register_script( 'js','https://code.jquery.com/jquery-1.7.min.js' );
wp_register_script( 'moment-js','http://cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment.min.js' );
wp_register_script( 'ui-js','http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"' );
wp_register_script( 'full-js', 'http://cdnjs.cloudflare.com/ajax/libs/fullcalendar/2.1.1/fullcalendar.min.js' );
wp_enqueue_script('js');
wp_enqueue_script('moment-js');
wp_enqueue_script('ui-js');
wp_enqueue_script('full-js');
}
add_action('admin_enqueue_scripts', array( $this,'fullcalendar'));
this my page code
<div id="calender" >
</div>
<script>
jQuery(document).ready(function() {
jQuery('#calendar').fullCalendar({
});
});
</script>
Currently its not giving me any error nor its giving required result .
回答1:
your problem is most likely the spelling error in your div id-tag. The id is "calender" while your selector in the javascript is "calendar".
来源:https://stackoverflow.com/questions/31335399/how-to-add-jquery-full-calendar-plugin-in-wordpress-admin