<HTML>
<Head>
<Title> jquery_extend_test [simple inheritance] </title>
<SCRIPT src = "jquery-1.6.js"> </SCRIPT>
<SCRIPT src = "jquery_extend_test.js"> </SCRIPT>
<Style>
* {Margin: 0; padding: 0 ;}
H5 {
Background-color: Gray;
}
SPAN {
Background-color: yellow;
}
Pre {
Margin-top: 10px;
Color: # FFF;
Background-color: #000;
}
</Style>
</Head>
<Body>
<H5> 1. $ in jquery is equivalent to jquery [as a jquery class] </H5>
<H5> 2. jquery (function () {call fun1; call fun2 ;...}); <======> jquery (document ). ready (function () {call fun1; call fun2 ;..}); </H5>
<HR/>
<H5> $. FN. Extend ({funname: function () {}}); </H5>
<Input type = "button" id = "test1" value = "test1" onclick = "$ (this). showme ('prefix');"/>
<Span> instance method [$ (this). showme (prefix)] </span> <br/>
<H5> $. FN. funname = function () {}; ----- $. fn = jquery. fn = jquery. prototype [prototype is the prototype mode, which is implemented by copying objects-different from class/static methods] </H5>
<Input type = "button" id = "Test2" value = "Test2" onclick = "$ (this). showme1 ('prefix');"/>
<Span> instance method [$ (this). showme1 (prefix)] </span> <br/>
<H5> $. Extend ({funname: function () {}}); </H5>
<Input type = "button" id = "test3" value = "test3" onclick = "$. showappointedone ($ ('# test3');"/>
<Span> class/static method [$. showappointedone ($ ('# test3')] </span> <br/>
<PRE onclick = "(function (arg1) {alert (arg1) ;}) ('argteststr');">
Original JavaScript-Anonymous Function Definition + execution [click]
(Function (arg1 ){
Alert (arg1 );
}) ('Argteststr ');
</PRE>
<PRE onclick = "(function ($) {alert ($ ('# test1'). Val () ;}) (jquery);">
Jquery anonymous Function Definition + execution [click]
(Function ($ ){
Alert ($ ('# test1'). Val ());
}) (Jquery );
</PRE>
</Body>
<SCRIPT>
</SCRIPT>
</Html>