Codex tools: Log in
<?php wp_localize_script( $handle, $object_name, $l10n ); ?>
wp_enqueue_script( 'some_handle' );
$translation_array = array( 'some_string' => __( 'Some string to translate' ), 'a_value' => '10' );
wp_localize_script( 'some_handle', 'object_name', $translation_array );
IMPORTANT!: wp_localize_script() MUST be called after the script it's being attached to has been enqueued or registered. It doesn't put the localized script in a queue for later scripts.
alert(object_name.some_string); // alerts 'Some string to translate'
FinalZoom = map.getBoundsZoomLevel(bounds)-parseInt(data.a_value); // Call a function that needs an int.
wp_localize_script() is located in
Enqueue functions: wp_register_script(), wp_deregister_script(), wp_enqueue_script(), wp_dequeue_script(), wp_localize_script(), wp_script_is(), wp_register_style(), wp_deregister_style(), wp_enqueue_style(), wp_dequeue_style(), wp_style_is()