Im trying to paste my javascript into footer and cant figure out.
function js_enqueue_search(){
wp_register_script("search", get_stylesheet_directory_uri() . "/js/search.js", "", wp_get_theme()->get("Version"), true);
wp_localize_script('search', 'search_ajax', array("ajaxurl" =>admin_url("admin-ajax.php")));
}
add_action("wp_enqueue_scripts", "js_enqueue_search");
wp_enqueue_script( 'search');
after it's registered.