Click here to Skip to main content
15,892,768 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: Angular Js, MongoDB, Javascript Pin
Richard MacCutchan26-May-15 23:27
mveRichard MacCutchan26-May-15 23:27 
GeneralRe: Angular Js, MongoDB, Javascript Pin
Member 1166176427-May-15 0:38
Member 1166176427-May-15 0:38 
GeneralRe: Angular Js, MongoDB, Javascript Pin
Richard MacCutchan26-May-15 23:30
mveRichard MacCutchan26-May-15 23:30 
AnswerRe: Angular Js, MongoDB, Javascript Pin
ZurdoDev27-May-15 2:05
professionalZurdoDev27-May-15 2:05 
QuestionDisplay value from database in jvector Map Pin
Member 1127102925-May-15 0:26
professionalMember 1127102925-May-15 0:26 
QuestionHow to read UI element value using jQuery (context vs find) ? Pin
Anjum.Rizwi25-May-15 0:03
professionalAnjum.Rizwi25-May-15 0:03 
AnswerRe: How to read UI element value using jQuery (context vs find) ? Pin
Libin Emmanuel25-May-15 2:07
Libin Emmanuel25-May-15 2:07 
AnswerRe: How to read UI element value using jQuery (context vs find) ? Pin
Richard Deeming27-May-15 2:22
mveRichard Deeming27-May-15 2:22 
All three examples you have given are using ID selectors[^]. Since each ID within the document should be unique, there's no point specifying the ID of the parent element, using the .find method, or passing the parent element with the selector.

With an ID selector, jQuery uses the document.getElementById function, which is extremely efficient. All of your examples will require additional checks, which will slow your code down.

Also, by specifying the parent element's ID, your script is now tied to the layout of your document.

Therefore, I would prefer option 4:
JavaScript
PriorityOfAccessModel:
{
    Id: $('#Id').val(),
    FamilyId: $('#FamilyId').val(),
    ChildId: $('#ChildId').val(),
    Comment: $('#Comment').val(),
    CreatedBy: $('#CreatedBy').val(),
    CreatedOn: $('#CreatedOn').val(),
    Categories: accessPriority.getCategory(),
    Allocating: { Id: allocating }
}




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


QuestionHow to call ajax in php databse file in jvector map? Pin
Member 1127102920-May-15 1:49
professionalMember 1127102920-May-15 1:49 
QuestionRe: How to call ajax in php databse file in jvector map? Pin
ZurdoDev20-May-15 8:56
professionalZurdoDev20-May-15 8:56 
QuestionjQuery validates all required fields except file upload. Pin
samflex19-May-15 8:29
samflex19-May-15 8:29 
AnswerRe: jQuery validates all required fields except file upload. Pin
ZurdoDev20-May-15 8:56
professionalZurdoDev20-May-15 8:56 
GeneralRe: jQuery validates all required fields except file upload. Pin
samflex21-May-15 2:40
samflex21-May-15 2:40 
GeneralRe: jQuery validates all required fields except file upload. Pin
Richard Deeming21-May-15 5:51
mveRichard Deeming21-May-15 5:51 
QuestionHow to pass image in javascript? Pin
Shän Yü18-May-15 2:56
Shän Yü18-May-15 2:56 
QuestionRe: How to pass image in javascript? Pin
2Programmer7829-May-15 11:38
2Programmer7829-May-15 11:38 
QuestionBase64 string corrupted or truncated Pin
JeganMaria18-May-15 0:51
JeganMaria18-May-15 0:51 
Questiondesign a game Pin
Member 116724807-May-15 9:17
Member 116724807-May-15 9:17 
AnswerRe: design a game Pin
ZurdoDev7-May-15 9:22
professionalZurdoDev7-May-15 9:22 
Questiondesign a game Pin
Member 116724807-May-15 9:15
Member 116724807-May-15 9:15 
AnswerRe: design a game Pin
ZurdoDev7-May-15 9:23
professionalZurdoDev7-May-15 9:23 
JokeRe: design a game Pin
CodeReady7-May-15 21:32
CodeReady7-May-15 21:32 
GeneralRe: design a game Pin
Sascha Lefèvre31-May-15 10:02
professionalSascha Lefèvre31-May-15 10:02 
GeneralRe: design a game Pin
CodeReady9-Jun-15 20:26
CodeReady9-Jun-15 20:26 
AnswerRe: design a game Pin
Anurag Gandhi31-May-15 2:29
professionalAnurag Gandhi31-May-15 2:29 

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.