I have the following jQuery:
j(".refreshMe").html(html);
var something = $("li", html).length;
if ( something > 0 ) {
j('.showlatest').slideDown();
}
and HTML:
<p class="showlatest"></p>
What I want to happen is,
if ( something > 0 ) {
j('.showlatest').slideDown();
ADD THE CONTENTS OF 'something' WITH THE TEXT 'NEW MESSAGES'
}
E.g.
<p class="showlatest">2 new messages</p>
I suppose I could define the 'New Messages' text as:
var newmessages = "New Messages";
But how can I then, in PHP speak, echo the results?
$('.showlatest').html(something + ' new message')? Note, you should be using id instead of class if these are single things. The selectors will be more efficient.jto$or$j.jwill be used in nestedforloops.for (j = 0; j < something; j++). You should change that tovar $j = jQuery.noConflict();. Unless you're already using a different$library, you shouldn't do it at all.