.addClass not updating page, but does through debugger!
I have this simple section of code:
- if (field != null) {
- var data = snapshot[key];
- var value = data['name'] ? data['name'] : data;
- var prevValue = field.val();
-
- field.val(value);
-
- if (prevValue != value) {
- field.addClass('lvd-value-changed');
- }
- else {
- field.removeClass('lvd-value-changed');
- }
- }
I am using a socket technology that sends the data directly to the browser. I get a snapshot of data as JSON. I am able to see the values change correctly. What I am not seeing is the CSS styles from the addClass / removeClass calls. If I step though the code with FireBug or Chrome debugger then I do see the CSS style changes.
Any times are greatly appreciated!