JQuery Introduction & JQuery Search Characters



We mainly use J Query for searching for some items on the page & doing something with them .

The JQuery functions which finds the items on the page are called selectors.

Base Selector in J Query is JQuery() or $() function.

String arguments can be passed to this functions in three ways 
 
Select by Element: This finds the elements with specific tag name & returns the array of that.
E.g.: $(“h2”) – this will find all <h2> tags.

Select by ID: This finds the elements which has the specified ID. We use “#” character to find the ID.
E.g.: 1) $(“#div1”) ---then this will search the elements which have the ID=div1.  
         2) If you want to search the element <div ID=”mydiv”> then JQuery would be $(“#mydiv”).

Select by CSS: this finds the elements with specific CSS class names. We use “.” to find the CSS class.
E.g.: 1) $(“.divStyle”) ---then it will search for the element which has CSS class as divStyle.
         2) If we want to search for the element <div class=”myDiv”> then JQuery will be $(“.myDiv”).

1.
There are some search characters used in JQuery to find the specific elements.

1.       “*” (asterisk) character: This is used to search the specified search term in the elements.
E.g.: $(“a[href*=net]”) ---- this will search in all <a> tags which has the text “net” as the part of the href attribute.

2.       “^” (caret) character: This is used to search the specified search term at the starting of the string.
E.g. $(“a[href^=folder/]”) ---- This will search in all <a> tags which has the text “folder/” at the beginning of the href attribute.

3.       “$” (dollar) character: This is used to search the specified search term at the end of the string. 
      E.g. $(“a[href$=in]”) ---- This will search for all <a> tags which has the text “in” at the end of the href      attribute.

4.       “!” (exclamation) character: This is used to search the elements whose attributes do not match the specified string 
      E.g.: $(“a[href!==http://www.google.com]”) ---- This will search for all <a> tags whose href attribute is not equal to www.google.com

OperationContract attributes/properties of the WCF in .net framework 4.0


OperationContract attributes/properties
 
1.      Action:
 
2.      AsycnPattern:
 
3.      IsInitiating:If we are using this attribute the SessionMode attribute of the ServiceContract 
      should be defined.It has two modes
a.      True:It is default mode .If IsInitiating property is true then that method can be 
called at the beginning.
b.      False: If IsInitiating property is false then that method cannot be called at the 
beginning.
 
4.      IsTerminating: If we are using this attribute the SessionMode attribute of the 
      ServiceContract should be defined.It has two modes
a.      True:If IsTerminating property is true then session will end after implementation 
of that method.
b.      False: IsTerminating property is true then session will not end after implementation 
of that method.
 
5.      Name: This is used to provide the name to the method by which client will call it.
 
6.      ProtectionLevel:It is System.Net.Security.ProtectionLevel which defines the protection 
      level of the service contract. It has three modes.
a.      EncryptAndSign: It ensures that data will be encrypted & signed before it 
is transmitted.
b.      None: Data will not be signed nor encrypted & it is transmitted as it is.
c.       Sign: Data will only signed before it is transmitted.
 
7.      ReplyAction:
 
8.      IsOneWay:It has two modes 
a.      True: It specifies that the method will not return anything. Method’s return type 
should be “void” if IsOnwWay is true.
b.      False: It is default value for the OperationContract. No need to specify this if 
method returns anything. 

Service Contract (ServiceContract) Attributes/properties of WCF in framework 4.0

ServiceContract has about 6 properties/attributes.

Service Contract Attributes

1.      CallbackContract:

2.      ConfigurationName:

3.      Name: This is used to provide the name to the service contract by which client will call it.

4.      Namespace: The namespace property is really an XML term. It allows you to maintain uniqueness with elements. So you can have multiple elements of the same tag name but they are completely different as long as they have different namespaces.

5.      ProtectionLevel: it is System.Net.Security.ProtectionLevel which defines the protection level of 
       the service contract. It has three modes.
a.      EncryptAndSign: It ensures that data will be encrypted & signed before it is transmitted.
b.      None: Data will not be signed nor encrypted & it is transmitted as it is.
c.       Sign: Data will only signed before it is transmitted.
 
6.      SessionMode: It Specifies that whether service contracts supports session or not.
      It has three modes
a.       Allowed: It specifies that if incoming binding supports session then it supports the session.
b.      NotAllowed: It specifies that contract will never support session & the never support 
the binding that initiates the session.
c.       Required: It specifies that contract needs session & exception is thrown if binding do not support the session.