zRSSFeed - How to sort feeds by title and date

This example shows how to sort feeds by title or date and ascending or descending order.

Script

$(document).ready(function () {
	setRSSFeed();	

	$('#sort').change(function() {
		setRSSFeed()
	});

	$('#direction').change(function() {
		setRSSFeed()
	});

	function setRSSFeed() {

		var a = $('#sort option:selected').val();
		var b = $('#direction option:selected').val();
		var c = (b == 'asc') ? true : false;
		
		$('#test').rssfeed('http://feeds.reuters.com/reuters/oddlyEnoughNews', {
			sort: a,
			sortasc: c
		});
	}
});

Select the type of sort and direction

Result