issue in wp_localize_script

I am initializing wp_localize_script after enqueueing scripts like that

wp_localize_script( ‘ajax-pagination’, ‘ajaxpagination’, array(
‘ajaxurl’ => admin_url( ‘admin-ajax.php’ )

but i am unable to get it in jquery file/code jquery code is

(function($) {
$(document).on( ‘click’, ‘.page-numbers’, function( event ) {
url: ajaxpagination.ajaxurl,
type: ‘post’,
data: {
action: ‘ajax_pagination’
success: function( result ) {
alert( result );

on clicking i am seeing the error ajaxpagination is not defined , what can be the possible solutions for this ?

Read more here:: issue in wp_localize_script

Leave a Reply

Your email address will not be published. Required fields are marked *