- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <HTML>
- <HEAD>
- <TITLE> jQuery </TITLE>
- </HEAD>
- <BODY>
- <SCRIPT LANGUAGE="JavaScript">
- <!--
- var jQuery = function(){
- // The jQuery object is actually just the init constructor 'enhanced'
- return new jQuery.fn.init();
- };
- jQuery.fn = jQuery.prototype = {
- init: function(){
- // Return jQuery object
- return this;
- },
- // The current version of jQuery being used
- jquery: "1.2.6",
- // The number of elements contained in the matched element set
- size: function() {
- return this.length;
- },
- // The number of elements contained in the matched element set
- length: 0
- };
- // Give the init function the jQuery prototype for later instantiation
- jQuery.fn.init.prototype = jQuery.fn;
- alert(jQuery().jquery);
- //-->
- </SCRIPT>
- </BODY>
- </HTML>
jQuery 源码分析
最新推荐文章于 2019-11-06 18:11:15 发布