I have an array in php, I took it in javascript using this variable
<script>
var myArray = <?php echo json_encode($id); ?>;
</script>
here is a sample data loaded in the javascript variable
var myArray = [{"product":"AMALFI COAST BISTRO WALKING","prod_id":179,"thumb":"/wp\/tangtours\/wp-content\/uploads\/2013\/04\/AMCWB_fi-148x106.jpg"},{"product":"ARGENTINA BIKING","prod_id":186,"thumb":"/wp\/tangtours\/wp-content\/uploads\/2013\/04\/ARGEB_fi-148x106.jpg"},{"product":"CHINA PRIVATE","prod_id":188,"thumb":"/wp\/tangtours\/wp-content\/uploads\/2013\/04\/CHNR2B_fi-148x106.jpg"},{"product":"BORDEAUX TO DORDOGNE BIKING","prod_id":191,"thumb":"/wp\/tangtours\/wp-content\/uploads\/2013\/04\/BDOBS_fi-148x106.jpg"},{"product":"AMERICAN WEST COAST BESPOKE","prod_id":198,"thumb":"/wp\/tangtours\/wp-content\/uploads\/2013\/04\/AWCB1_fi-148x106.jpg"},{"product":"BHUTAN PRIVATE","prod_id":195,"thumb":"/wp\/tangtours\/wp-content\/uploads\/2013\/04\/BTNR2B_fi-148x106.jpg"}];
All I have to do is to sort this content using jquery or javascript by product, prod_id and thumb.
is there any simple way to sort this content and print them in a div in Ascending and descending order using jquery or javascript?
this is a sample site http://www.butterfield.com/tripfinder/ of what I really need. please use sort by options on the right top, they used dojo to do it, and I am not much familiar with dojo anyway. thank you.