Click here to Skip to main content
15,905,071 members
Home / Discussions / JavaScript
   

JavaScript

 
AnswerRe: AngularJS:How to indentify which angular code we need to run manually by angular.bootstrap function Pin
Nathan Minier16-Mar-16 2:15
professionalNathan Minier16-Mar-16 2:15 
GeneralRe: AngularJS:How to indentify which angular code we need to run manually by angular.bootstrap function Pin
Tridip Bhattacharjee16-Mar-16 21:32
professionalTridip Bhattacharjee16-Mar-16 21:32 
GeneralRe: AngularJS:How to indentify which angular code we need to run manually by angular.bootstrap function Pin
Nathan Minier17-Mar-16 1:55
professionalNathan Minier17-Mar-16 1:55 
GeneralRe: AngularJS:How to indentify which angular code we need to run manually by angular.bootstrap function Pin
Tridip Bhattacharjee17-Mar-16 3:37
professionalTridip Bhattacharjee17-Mar-16 3:37 
GeneralRe: AngularJS:How to indentify which angular code we need to run manually by angular.bootstrap function Pin
Nathan Minier17-Mar-16 3:56
professionalNathan Minier17-Mar-16 3:56 
QuestionHow do can I communicate to Graphtech Cutting Plotters by JavaScript or Jquery? Pin
tienich7-Mar-16 20:07
tienich7-Mar-16 20:07 
AnswerRe: How do can I communicate to Graphtech Cutting Plotters by JavaScript or Jquery? Pin
Richard MacCutchan7-Mar-16 22:02
mveRichard MacCutchan7-Mar-16 22:02 
GeneralRe: How do can I communicate to Graphtech Cutting Plotters by JavaScript or Jquery? Pin
tienich17-Mar-16 6:46
tienich17-Mar-16 6:46 
AnswerRe: How do can I communicate to Graphtech Cutting Plotters by JavaScript or Jquery? Pin
Nathan Minier11-Mar-16 1:30
professionalNathan Minier11-Mar-16 1:30 
GeneralRe: How do can I communicate to Graphtech Cutting Plotters by JavaScript or Jquery? Pin
tienich17-Mar-16 6:46
tienich17-Mar-16 6:46 
QuestionPhoneGap Pin
vivek rajavel2-Mar-16 23:23
vivek rajavel2-Mar-16 23:23 
SuggestionRe: PhoneGap Pin
Richard Deeming2-Mar-16 23:43
mveRichard Deeming2-Mar-16 23:43 
GeneralRe: PhoneGap Pin
vivek rajavel3-Mar-16 0:11
vivek rajavel3-Mar-16 0:11 
Questionng-grid wrap-text rows with verical scrolling Pin
Stephen Holdorf1-Mar-16 14:35
Stephen Holdorf1-Mar-16 14:35 
AnswerRe: ng-grid wrap-text rows with verical scrolling Pin
Stephen Holdorf2-Mar-16 13:48
Stephen Holdorf2-Mar-16 13:48 
GeneralRe: ng-grid wrap-text rows with verical scrolling Pin
Stephen Holdorf3-Mar-16 2:59
Stephen Holdorf3-Mar-16 2:59 
QuestionRotation functionality is not working in viewer Pin
Member 1235806428-Feb-16 19:10
Member 1235806428-Feb-16 19:10 
Questionif click on one hyperlink navigate another Page(It contains image map-Healight Perticualr location) Pin
Member 1131823316-Feb-16 21:00
Member 1131823316-Feb-16 21:00 
AnswerRe: if click on one hyperlink navigate another Page(It contains image map-Healight Perticualr location) Pin
aarif moh shaikh19-Feb-16 20:55
professionalaarif moh shaikh19-Feb-16 20:55 
QuestionHelp Needed Pin
Member 1231273311-Feb-16 10:43
Member 1231273311-Feb-16 10:43 
QuestionRe: Help Needed Pin
ZurdoDev23-Feb-16 9:02
professionalZurdoDev23-Feb-16 9:02 
QuestionJquery, changing span values with HTML5 data attr inside a div Pin
jkirkerx11-Feb-16 9:50
professionaljkirkerx11-Feb-16 9:50 
AnswerRe: Jquery, changing span values with HTML5 data attr inside a div Pin
Richard Deeming11-Feb-16 10:17
mveRichard Deeming11-Feb-16 10:17 
The each function iterates through all of the elements matched by the selector - ie: the div elements with the specified data attribute. It doesn't iterate over the descendants of the matched items, which is what you're trying to do.

You don't actually need to iterate over the descendants. You can just find the relevant span elements and update them directly:
JavaScript
var dRecord = $('div.cartRecord[data-cartID="' + _cartID + '"]');
dRecord.find("span[data-qty]").html(data.Qty).data("qty", data.Qty);
dRecord.find("span[data-total]").html(data.Total).data("total", data.Total);

Also worth noting that the return from the $ function will never be null. If there are no matching elements, you'll still get a jQuery object back, with a length of zero.



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Jquery, changing span values with HTML5 data attr inside a div Pin
jkirkerx11-Feb-16 10:54
professionaljkirkerx11-Feb-16 10:54 
GeneralRe: Jquery, changing span values with HTML5 data attr inside a div Pin
Nathan Minier12-Feb-16 1:55
professionalNathan Minier12-Feb-16 1:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.