Function in JQuery
Once i want to execute same set of codes for two common events in jquery. ie, i want to execute the code while
1 . Changes occur in dropdown
2 . While page Load.
At, that time i planned to use bind() function.But if i use bind() i should use the same code for two times.So, i planned to implement that using OR( || ) condition.But, i think it is not available..So i searched jquery.com & finally got one beautiful solution.
That Solution is Normal FUNCTION ( ) like C,C++.i call this function two times only with one set of code.That example is below..
Example:
$(“#level”).change( changes ); // call – 1
$(document).ready( changes ); // call – 2
function changes()
{
——
Set of code
——
}
Reference : http://api.jquery.com/bind/
Advertisements
Comments (0)
Trackbacks (0)
Leave a comment
Trackback