I am trying to destroy elements on page load.
Here is my jQuery:
<script type="text/javascript">
var amount = 0;
$('li.<?php echo $username ;?>').each(function() {
amount++
if (amount > 1) {
$(this).destroy();
}
});
</script>
For some reason .destory does not work. I am limiting the list items to 1, but the above will still generate all list items.
I have got around this by using .remove. The only problem is, there are thousands of elements to load, and are still loading in the dom. This is causing very long loading times.
Any ideas on what else i could try?
Cheers, Dan