我在worpress页面中有一个链接
<a onclick="show_trend()" >Trend</a>
我正在调用一个ajax函数onclick。function show_trend() {
// This does the ajax request
$.ajax({
url: ajaxurl,
data: {
\'action\':\'render_admin_charts_page\',
},
success:function(data) {
// This outputs the result of the ajax request
console.log(data);
},
error: function(errorThrown){
console.log(errorThrown);
}
});
}
调用此函数时,我要做的是显示div部分。为此,这是我的职责function render_admin_charts_page() {
?>
<div class="wrap">
<div class="em-bookings-events">
<h2><?php esc_html_e(\'Event Booking Report\',\'dbem\'); ?></h2>
<?php em_bookings_events_table(); ?>
</div>
</div>
<?php
}
ajax函数正在调用但未呈现到div