Easiest way to sort a select element using Jquery

If you are using jquery sorting a select element is quite easy. Check the below code. $(“#select-id”).html( $(“#select-id option”).sort(function (a, b) { return a.text == b.text ? 0 : a.text < b.text ? -1 : 1; }));

How to call external site url using jQuery / AJAX 3

Recently I worked on a project where I had to pull data from an external site and populate a select on client’s website. Initially I thought it would be quite easy and straight forward. I used jQuery ajax request to fetch the data. But to my surprise I was not getting request call or any ...