Hi
I'm new to jquery and trying to impress at a new job!!
I am having difficulty displaying elements across 2 div's. I used the :lt() selector to display the first 20.
I tried using the slice() method for the next div, but that did not appear to work and Firebug wasn't showing any errors.Code:<script type="text/javascript">// <![CDATA[ $(document).ready(function(){ $.ajax({ url: 'http://action.savethechildren.org.uk/ea-dataservice/data.service?service=EaDataCapture&token=5a84aa1e-f378-40e6-bcf3-d7c1aea81e61&campaignId=14404&resultType=detail', dataType: "xml", success: function(xml) { $(xml).find("EaRow:lt(20)").each(function(){ var fname = $(this).find('EaColumn[name="First Name"]').text() +(" - "); var town = $(this).find('EaColumn[name=Town]').text() +("<br />"); $("fname").css("color", "red"); $("div#G8_List_of_NamesDiv").append(fname) .append(town); // $("div#List_of_CountriesDiv").append(fname) .append(town) }); } }); }); // ]]></script>
Please help...thanksCode:.... $(xml).find("EaRow .slice(21,40)").each(function() ....


Reply With Quote
Bookmarks