I'm looking for examples to make a filter (in the left sidebar) that when clicking on a filter updates the page content (Query), and if (the filter) has subcategories, it displays them down the selected filter (in the left sidebar).
I found that AJAX is used for this, but this works with XML files, and I use JSON. Can AJAX be used with JSON?
Thank you very much to anyone who can contribute something. Greetings.
JSON is definitely a valid data type for AJAX. All you have to do is specify the data-type in your call, otherwise it will default to text. For example:
$.ajax({
type: 'GET',
url : 'http://example.com',
dataType : 'json',
success : function( data ) {
console.log(data);
}
});