rivkamak
asked on
DOM not updating after jQuery change
I have my page here:
https://torahmates.org/mileage/prizesDetailsTemp.php?cat=Electronics
It has a lot of LI in my UL
I put a jquery sort function. If you click that orange button to SORT ASC.
You can see if you inspect element, that the LI all get sorted in point order.
But it is not updating in the DOM screen.
Any idea why?
https://torahmates.org/mileage/prizesDetailsTemp.php?cat=Electronics
It has a lot of LI in my UL
I put a jquery sort function. If you click that orange button to SORT ASC.
You can see if you inspect element, that the LI all get sorted in point order.
But it is not updating in the DOM screen.
Any idea why?
use a browser like Chrome to check and not MS IE which doesn't update the DOM
I mean in the developper view...
$('#sortasc').click(function () {
var deferred = sortMeBy("data-points", "ul.portfolio-items", "li", "asc");
//$('#ul.portfolio-items').html(deferred); // <=== commented code will not run
Where is the code to add it to the DOM? The only statement that can do that you have commented out (See above)
ASKER
In you code above, the #2, is what sorts it.
i thought I had to pass in the html ,but that doesn't make a difference.
By line #2, the inspect element shows it's sorted.
And I was checking it in chrome.
i thought I had to pass in the html ,but that doesn't make a difference.
By line #2, the inspect element shows it's sorted.
And I was checking it in chrome.
Yes but you have to add it to the DOM it is not going to get there by itself.
//$('#ul.portfolio-items').html(deferred); // <=== why is this commented out?
ASKER
I took out that commented line but it's not helping.
It's not changing on my screen even thought the DOM got changed.
It's not changing on my screen even thought the DOM got changed.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.