J Query
J Query
J Query
jQuery
JavaScript code, which do document traversing, event handling, Ajax interactions and Animations.
jQuery connect
plugin used to connect or bind a function with another function
use connect
Use $.connect function to connect a function to another function.
Whether we need to add jQuery file in both Master and Content page
jQuery file should be added to the Master page and can use access from the content page directly without
having any reference to it
jQuery.data method
used to associate the data with the DOM nodes and the objects
testing jQuery
QUnit
What is CDN
Distribution network ,a group of companies in different location with network containing copies of data files
to maximize bandwidth in accessing the data.
script build up
single javascript file that contains common DOM, event effects and Ajax functions.
debug jQuery
There are two ways to debug jQuery:
Debugger keyword
Add the debugger to the line from where we have to start debugging and then run Visual Studio in Debug
mode with F5 function key.
Insert a break point after attaching the process
download JQuery
from jQuery official website – www.jquery.com
is a replacement of JavaScript
No
chaining
used to connect multiple events and functions in a selector.
advantages of jQuery
Just a JavaScript enhancement
Coding is simple, clear, reusable
Removal of writing more complex conditions and loops
each function
each and every element of the target jQuery object.
selectors in jQuery
Name,#ID,Class,Universal (*),Multiple Elements E, F, G,Attribute Selector
use of val()
get the current value
animate()
$(selector).animate({params}, [duration], [easing], [callback])
jQuery or JavaScript
native DOM method is faster than calling a JavaScript
* $("*")
#id $("#lastname")
.class $(".intro")
.class,.class $(".intro,.demo")
element $("p")
el1,el2,el3 $("h1,div,p")
:first $("p:first")
:last $("p:last")
:even $("tr:even")
:odd $("tr:odd")
:first-child $("p:first-child")
:first-of-type $("p:first-of-type")
:last-child $("p:last-child")
:last-of-type $("p:last-of-type")
:nth-child(n) $("p:nth-child(2)")
:nth-last-child(n) $("p:nth-last-child(2)")
:nth-of-type(n) $("p:nth-of-type(2)")
:nth-last-of-type(n) $("p:nth-last-of-type(2)")
:only-child $("p:only-child")
:only-of-type $("p:only-of-type")
:header $(":header")
:animated $(":animated")
:focus $(":focus")
:contains(text) $(":contains('Hello')")
:has(selector) $("div:has(p)")
:empty $(":empty")
:parent $(":parent")
:hidden $("p:hidden")
:visible $("table:visible")
:root $(":root")
:lang(language) $("p:lang(de)")
[attribute] $("[href]")
[attribute=value] $("[href='default.htm']")
[attribute!=value] $("[href!='default.htm']")
[attribute$=value] $("[href$='.jpg']")
[attribute|=value] $("[title|='Tomorrow']")
[attribute^=value] $("[title^='Tom']")
[attribute~=value] $("[title~='hello']")
[attribute*=value] $("[title*='hello']")
:input $(":input")
:text $(":text")
:password $(":password")
:radio $(":radio")
:checkbox $(":checkbox")
:submit $(":submit")
:reset $(":reset")
:button $(":button")
:image $(":image")
:file $(":file")
:enabled $(":enabled")
:disabled $(":disabled")
:selected $(":selected")
:checked $(":checked")
bind() event.pageY
blur() event.preventDefault()
change() event.relatedTarget
click() event.result
dblclick() event.stopImmediatePropagation()
delegate() event.stopPropagation()
die() event.target
error() event.timeStamp
event.currentTarget event.type
event.data event.which
event.delegateTarget focus()
event.isDefaultPrevented() focusin()
event.isImmediatePropagationStopped() focusout()
event.isPropagationStopped() hover()
event.namespace keydown()
event.pageX keypress()
$.proxy() keyup()
ready() live()
resize() load()
scroll() mousedown()
select() mouseenter()
submit() mouseleave()
toggle() mousemove()
trigger() mouseout()
triggerHandler() mouseover()
unbind() mouseup()
undelegate() off()
unload() on()
one()
animate() hide()
clearQueue() queue()
delay() show()
dequeue() slideDown()
fadeIn() slideToggle()
fadeOut() slideUp()
fadeTo() stop()
fadeToggle() toggle()
finish()
addClass() position()
after() prepend()
append() prependTo()
appendTo() prop()
attr() remove()
before() removeAttr()
clone() removeClass()
css() removeProp()
detach() replaceAll()
empty() replaceWith()
hasClass() scrollLeft()
height() scrollTop()
html() text()
innerHeight() toggleClass()
innerWidth() unwrap()
insertAfter() val()
insertBefore() width()
offset() wrap()
offsetParent() wrapAll()
outerHeight() wrapInner()
outerWidth()
add() next()
addBack() nextAll()
andSelf() nextUntil()
children() not()
closest() offsetParent()
contents() parent()
each() parents()
end() parentsUntil()
eq() prev()
filter() prevAll()
find() prevUntil()
first() siblings()
has() slice()
is()
last()
map()
$.ajax() ajaxComplete()
$.ajaxPrefilter() ajaxError()
$.ajaxSetup() ajaxSend()
$.ajaxTransport() ajaxStart()
$.get() ajaxStop()
$.getJSON() ajaxSuccess()
$.parseJSON() load()
$.getScript() serialize()
$.param() serializeArray()
$.post()
data() size()
each() toArray()
get() context
index() jquery
$.noConflict() jQuery.fx.interval
$.param() jQuery.fx.off
removeData() jQuery.support
length