Code is running. But I need when page is loaded my xml data display with date sort. Can you please help me out with this issue? I have tried and put one function on window.load. It is working first time, but when I refresh the page. xml data is not sorted.\[code\]$(document).ready(function(){ var intCnt = 0; var per_row = 1; var html = ""; html +='<table width="100%" border="0" cellspacing="2" cellpadding="0" class="rsstblall"><thead><tr>'+ '<th width="100">Date</th>'+ '<th>News</th></tr></thead></table>'; html += '<table width="100%" border="0" cellspacing="2" cellpadding="0" class="rssfeedData">'; $.get("xmldata.xml",function(xml){ $('item', xml).each(function(){ var title = $(this).find("title").text(); var link = $(this).find("link").text(); var category = $(this).find("category").text(); var date = $(this).find("date").text(); x = new Date (date); yr = x.getFullYear (); m = (x.getMonth()+1); dt = x.getDate() var dates2 = dt+"/"+m+"/"+yr; if (category2.indexOf("ALL") >= 0){ html += '<tr class="node item">'+ '<td valign="top" align="right" class="info1">'+ dates2 +'</td>'+ '<td valign="top"><a href="' + link + '" target="_blank">'+ title +'</a></td>'+ '</tr>'; intCnt++; }});\[/code\]Load the xml data with date sort. but not working when page refreshed.\[code\]$(window).load(function() { var itemsArray = $('tr.node'); itemsArray.sort(function(a,b){ var aTime = new Date(parseDate($(a).find('.info1').text())); var bTime = new Date(parseDate($(b).find('.info1').text())); return (aTime < bTime ? -1 : (aTime > bTime ? +1 : 0)); function parseDate(input) { var parts = input.match(/(\d+)/g); var date1 = new Date(parts[2], parts[1], parts[0], 0, 0, 0); return date1; } }); $(itemsArray).each(function(){ $(".rssfeedData tbody").prepend($(this)); }); }); html +='</table>';$('#Div1').empty();$('#Div1').append(html);});});<!-- XML DATA File: xmldata.xml --><channel> <item> <title>title 1</title> <link>http://www.sample.com/</link> <description>Lorem IpusmLorem IpusmLorem IpusmLorem IpusmLorem </description> <date>Thu, 15 Nov 2012 00:00:00 -0500</date> <category>ALL</category> </item> <item> <title>title 2</title> <link>http://www.sample.com/</link> <date>Tue, 27 Nov 2012 00:00:00 -0500</date> <category>ALL</category> </item> <item> <title>title 3</title> <link>http://www.sample.com/</link> <description>Lorem IpusmLorem IpusmLorem kkk</description> <date>Sun, 26 Jun 2011 00:00:00 -0400</date> <category>ALL</category> </item> <item> <title>title 4</title> <link>http://www.sample.com/</link> <description>Lorem IpusmLorem IpusmLorem iii</description> <date>Thu, 02 Sep 2010 00:00:00 -0400</date> <category>ALL</category> </item> <item> <title>title 5</title> <link>http://www.sample.com/</link> <description>Lorem IpusmLorem IpusmLorem hhh</description> <date>Wed, 10 Oct 2012 00:00:00 -0400</date> <category>ALL</category> </item> <item> <title>title 1</title> <link>http://www.sample.com/</link> <description>Lorem IpusmLorem IpusmLorem ggg</description> <date>Wed, 01 Sep 2010 00:00:00 -0400</date> <category>ALL</category> </item> <item> <title>title 6</title> <link>http://www.sample.com/</link> <description>Lorem IpusmLorem IpusmLorem fff</description> <date>Mon, 05 Nov 2012 00:00:00 -0500</date> <category>ALL</category> </item> <item> <title>title 7</title> <link>http://www.sample.com/</link> <description>Lorem IpusmLorem IpusmLorem eee</description> <date>Fri, 01 Jun 2012 00:00:00 -0400</date> <category>ALL</category> </item> <item> <title>title 8</title> <link>http://www.sample.com/</link> <description>Lorem IpusmLorem IpusmLorem IpusmLorem ddd</description> <date>Thu, 29 Nov 2012 00:00:00 -0500</date> <category>ALL</category> </item> <item> <title>title9</title> <link>http://www.sample.com/</link> <description>Lorem IpusmLorem xyz</description> <date>Thu, 29 Nov 2012 00:00:00 -0500</date> <category>ALL</category> </item> <item> <title>title 01</title> <link>http://www.sample.com/</link> <description>Lorem IpusmLorem abc</description> <date>Fri, 19 Nov 2010 00:00:00 -0500</date> <category>ALL</category> </item> <item> <title>title 11</title> <link>http://www.sample.com/</link> <description>Lorem IpusmLorem IpusmLorem IpusmLorem </description> <date>Mon, 02 Aug 2010 00:00:00 -0400</date> <category>ALL</category> </item></channel><!-- End XML DATA --><!-- START HTML --><div id="Div1"></div>\[/code\]