I am having an issue with the a href="#" still working when the link is clicked - I can see the console.log() before the page changes - why is it doing this?
HTML:
<a href="#" id="brands_by_category_change_name_btn" class="btn btn-primary" >Save</a>
JS:
        $('body').on("click", "#brands_by_category_change_name_btn", function () {
            var self = $(this);
            var id = $("#product_name_head").data("productid");
            var cat_id = $(".product_category_selector").data("id");
            var url = $("#manufacturers_table").data("infourl");
            var state = "0";
            if(self.is(":checked"))
            {
                state = "1";
            }
            var data_array = { 
                    id : id, 
                    cat_id : cat_id, 
                    state : state
                };
                console.log(url);
            //ajaxCall(url, data_array, null, "reload_selected_product_categories");
        });  
 
     
     
    