Link to home
Start Free TrialLog in
Avatar of rivkamak
rivkamakFlag for United States of America

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?
Avatar of leakim971
leakim971
Flag of Guadeloupe image

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

Open in new window

           
Where is the code to add it to the DOM? The only statement that can do that you have commented out (See above)
Avatar of rivkamak

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.

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?

Open in new window

I took out that commented line but it's not helping.
It's not changing on my screen even thought the DOM got changed.

ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial