No need to get blog ids via ajax, use wp_localize_script() instead