1function co_handle_combo_change() { 2 var co_url = co_ajax_obj.ajax_url; 3 var co_offerlist = document.getElementById(co_ajax_obj.offerlist); 4 var co_filter = document.getElementById(co_ajax_obj.filter); 5 var loc = document.getElementById("co-location-filter"); 6 var cat = document.getElementById("co-category-filter"); 7 var fld = document.getElementById("co-field-filter"); 8 if ((loc === null) || (loc.selectedIndex == 0)) 9 loc = ""; 10 else 11 loc = loc.value; 12 if ((cat === null) || (cat.selectedIndex == 0)) 13 cat = ""; 14 else 15 cat = cat.value; 16 if ((fld === null) || (fld.selectedIndex == 0)) 17 fld = ""; 18 else 19 fld = fld.value; 20 co_offerlist.innerHTML = '<div id="' + co_ajax_obj.offerlist + '">loading...</div>'; 21 //use in callback 22 // $ is not available here! 23 jQuery.post(co_ajax_obj.ajax_url, { //POST request 24 _ajax_nonce: co_ajax_obj.nonce, //nonce 25 action: "co_filter_ajax", //action 26 cf_category: cat, //data 27 cf_location: loc, 28 cf_field: fld 29 }, function(data) { 30 var jsonObj = JSON.parse(data); 31 co_offerlist.innerHTML = jsonObj.offerlist; 32 co_filter.innerHTML = jsonObj.filter; 33 // Rehook new controles to the combo_change function ($ is not available here!) 34 jQuery(".co-filter-combo").change(function() { 35 co_handle_combo_change(); 36 }); 37 }); 38} 39 40jQuery(document).ready(function($) { 41 $(".co-filter-combo").change(function() { //event 42 co_handle_combo_change(); 43 }); 44});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.