How can I get the values of my WordPress $wpdb query in Jquery?

I was able to solve this by using the WooCommerce api with only jQuery. $(“.check-zip”).on(‘click’, function () { var zipCode = jQuery(“#custom_zip”).val(); var zipArray = []; var url = WPURLS.template_url; $(“.zip-msg”).remove(); $.ajax({ type: ‘GET’, url: url + ‘/wp-json/wc/v2/shipping/zones/1/locations’, dataType: “json”, data: { type: ‘postcode’ }, beforeSend: function (xhr) { xhr.setRequestHeader(‘X-WP-Nonce’, wpApiSettings.nonce); }, success: function (data) … Read more