Using jQuery, you can try to select sorts and check how many items are returned:
if ($('.sortable-class').length > 0) {}
The code above assumes that each of the elements of your sort has a class sortable-class . All you really need is a unique selector that only your sorts will find. For example, if your sorts are children of an element, your selector might look like this:
HTML
<ul id="sortable_parent"> <li>this is sortable</li> <li>this is also sortable</li> </ul>
Js
if ($('#sortable_parent').children('li').length > 0) {}
Here is some documentation if you do such things: http://api.jquery.com/length
source share