JQuery - Method equals to c# All()-method -


If I use C #, then to check that any element in the list is equal to propery value of objects , And if it does, do not add it to the list.

c #

  public class user {public string user {get}}  

set; }}

.

Private Static List & lt; Users & gt; UserList = new list & lt; Users & gt; ();

.

  string current user = context. the user. Identity; name; If (userList.All (o = & gt; OUUS! = Current user)) {userList.Add (new user {user = current user}); }  

JQuery attempt ...

I am trying to add items to a list. If the item is already in the list, then do not add it. This is never added to my poor contempt ... is a list of items with the property named userUserName / userUser user name string string (user, current username) {var CurrentUser = currentUserName; Var i = 0; (I = 0; i & lt; users.length; i ++) {if (user [i] .Uz!! = Current user) {$ ("#manim magas") .andand ('& lt; li & Gt; '+ User [i] .User +' & lt; / li & gt; '); }}};

It's really very easy to use jQuery on each of your users array Iter (user, function) (if ($ (this). User! = Current user name) {$ ($ (user, current user name) '# MonitorMgs'). Append ('');}}}} < P> EDIT: As told by troupe Or, you should actually use $. Every (from). I have written my sample again such as


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -