How can I count the number of list item on a different page?
hi there,
I've got two pages. Page_one.htm has an unordered list.
In page_two.htm I need to get the number of list items on page_one.htm.
I am using the following code:
-
var numList = ("page_one.htm #source li").length;
The above code doesn't work, so as an alternative I have tried loading the list from page_one.htm into a div with style="display:none" on page_two.htm and then counting the number of list items, like so:
jquery
-
$("#list_temp").load("page_one.htm #source");
var numList = $("#list_temp").length;
html
-
<div id="list_temp" style="display:none"></div>
This method doesn't work either
Does anyone know how I can do this, i.e. count the number of <li>s on another page?
Many thanks,
Katie