Creating multilingual glossary for WP

I have replaced this code from functions.php:

wp_localize_script( 'ajax-script', 'my_ajax_object',
            array( 'ajax_url' => admin_url( 'admin-ajax.php' ) ) );
    }

with this:

wp_localize_script("alphabetJS", "ajaxurl", admin_url("admin-ajax.php"));  

Then edited javascript

jQuery.post(my_ajax_object.ajaxurl, data, function(response) {

with this:

jQuery.post(ajaxurl, data, function(response) {