<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<script src="js/jquery.js"></script>
<body>
<script>
var result = $.extend({add:function(){ return (1+1)}},{'name':111,'age':1100},{del:function(){ alert('Del info!')}});
alert(result.add());
alert(result.name);
result.del();
$.extend({infos:function(){ alert('It is infos.');}});
$.infos(); //合并到jquery的全局对象中
$.fn.extend({myinfos:function(){ alert('It is myinfos');}});
var a = $("#div");
a.myinfos();//合并到jquery的实例对象中
</script>
<div id="div"></div>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<script src="js/jquery.js"></script>
<body>
<script>
var result = $.extend({add:function(){ return (1+1)}},{'name':111,'age':1100},{del:function(){ alert('Del info!')}});
alert(result.add());
alert(result.name);
result.del();
$.extend({infos:function(){ alert('It is infos.');}});
$.infos(); //合并到jquery的全局对象中
$.fn.extend({myinfos:function(){ alert('It is myinfos');}});
var a = $("#div");
a.myinfos();//合并到jquery的实例对象中
</script>
<div id="div"></div>
</body>
</html>