<!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" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>jQuery 1.2 API 参考文档中文版</title>
<meta name="keywords" content="jQuery 1.2 API Reference,Visual jQuery 1.2,jQuery doc,jQuery API,jQuery,jQuery 1.2 API 参考文档中文版,中文版" />
<meta name="description" content="jQuery 1.2 API 文档中文版,提供最新版 jQuery 开发帮助。" />
<link rel="stylesheet" type="text/css" href="style/jqueryapi.css" />
<script type="text/javascript" src="style/lib/jquery.js"></script>
<script type="text/javascript" src="style/lib/jquery.dimensions.js"></script>
<script type="text/javascript" src="style/lib/jquery.corner-min.js"></script>
<script type="text/javascript" src="style/jqueryapi.js"></script>
<link rel="shortcut icon" href="style/img/favicon.ico" />
</head>
<body>
<div id="topnav">
<a class="topnav" href="http://www.cloudream.name/" title="1.2版翻译协助者">Cloudream</a>
<span class="topnav">|</span>
<a class="topnav" href="http://mrwlwan.wordpress.com/" title="1.2版翻译样式作者">Ross Wan</a>
<span class="topnav">|</span>
<a class="topnav" href="http://www.cn-cuckoo.com/" title="1.1版译者">为之漫笔</a>
<span class="topnav">|</span>
<a class="topnav" href="http://shawphy.com/" title="1.2版翻译整理者">Shawphy</a>
<span class="topnav">|</span>
<a class="topnav" href="http://shawphy.com/jqueryapi/jqueryapi12.zip" title="1.2离线版下载">jQuery 1.2 API 离线版下载</a>
</div>
<div id="header"></div>
<hr style="color:#595959;" />
<div id="foldandexpand">
<button id="fold">折叠</button>
<button id="expand">展开</button>
<button id="foldall">折叠全部</button>
<button id="expandall">展开全部</button>
<input id="english" name="english" type="checkbox" value="" /><label for="english"> 英文说明</label>
</div>
<div class="mainmenu">
<!-- Core -->
<div class="menuitem">核心</div>
<div class="functionmenu">
<div class="categoryitem">jQuery 核心函数</div>
<div class="category">
<div class="functionitem">jQuery(expression,[context])</div>
<div class="content">
<h1>jQuery(expression,[context])</h1>
<div class="desc">
<div>这个函数接收一个包含 CSS 选择器的字符串,然后用这个字符串去匹配一组元素。
</div>
<div class="longdesc"><p>jQuery 的核心功能都是通过这个函数实现的。 jQuery中的一切都构建于这个函数之上,或者说都是在以某种方式使用这个函数。这个函数最基本的用法就是向它传递一个表达式(通常由 CSS 选择器组成),然后根据这个表达式来查找所有匹配的元素。</p><p>默认情况下, 如果没有指定context参数,$()将在当前的 HTML 文档中查找 DOM 元素;如果指定了 context 参数,如一个 DOM 元素集或 jQuery 对象,那就会在这个 context 中查找。</p><p>参考 Selectors 获取更多用于 expression 参数的 CSS 语法的信息。</p>
</div>
<hr />
<div>This function accepts a string containing a CSS selector which is then used to match a set of elements.
</div>
<div class="longdesc"><p>The core functionality of jQuery centers around this function. Everything in jQuery is based upon this, or uses this in some way. The most basic use of this function is to pass in an expression (usually consisting of CSS), which then finds all matching elements. </p><p>By default, if no context is specified, $() looks for DOM elements within the context of the current HTML document. If you do specify a context, such as a DOM element or jQuery object, the expression will be matched against the contents of that context. </p><p>See Selectors for the allowed CSS syntax for expressions.</p>
</div>
</div>
<h2>返回值</h2>
<p class="indent">jQuery</p>
<h2>参数</h2>
<p class="indent"><strong>expression </strong>(String) : 用来查找的字符串</p>
<p class="indent"><strong>context </strong>(Element, jQuery) : (可选) 作为待查找的 DOM 元素集、文档或 jQuery 对象。</p>
<h2>示例</h2>
<p class="indent">
找到所有 p 元素,并且这些元素都必须是 div 元素的子元素。
</p>
<p class="indent"><strong>HTML 代码:</strong></p>
<div class="code">
<p>one</p> <div><p>two</p></div> <p>three</p>
</div>
<p class="indent"><strong>jQuery 代码:</strong></p>
<div class="code">
$("div > p");
</div>
<p class="indent"><strong>结果:</strong></p>
<div class="code">
[ <p>two</p> ]
</div>
<hr />
<p class="indent">
在文档的第一个表单中,查找所有的单选按钮(即: type 值为 radio 的 input 元素)。
</p>
<p class="indent"><strong>jQuery 代码:</strong></p>
<div class="code">
$("input:radio", document.forms[0]);
</div>
<hr />
<p class="indent">
在一个由 AJAX 返回的 XML 文档中,查找所有的 div 元素。
</p>
<p class="indent"><strong>jQuery 代码:</strong></p>
<div class="code">
$("div", xml.responseXML);
</div>
</div>
<div class="functionitem">jQuery(html)</div>
<div class="content">
<h1>jQuery(html)</h1>
<div class="desc">
<div>根据提供的原始 HTML 标记字符串,动态创建由 jQuery 对象包装的 DOM 元素。
</div>
<div class="longdesc">你可以传递一个手写的 HTML 字符串,或者由某些模板引擎或插件创建的字符串,也可以是通过 AJAX 加载过来的字符串。但是在你创建 input 元素的时会有限制,可以参考第二个示例。当然这个字符串可以包含斜杠 (比如一个图像地址),还有反斜杠。当你创建单个元素时,请使用闭合标签或 XHTML 格式。例如,创建一个 span ,可以用 $("<span/>") 或 $("<span></span>") ,但不推荐 $("<span>")
</div>
<hr />
<div>Create DOM elements on-the-fly from the provided String of raw HTML.
</div>
<div class="longdesc">You can pass in plain HTML Strings written by hand, create them using some template engine or plugin, or load them via AJAX. There are limitations when creating input elements, see the second example. Also when passing strings that may include slashes (such as an image path), escape the slashes. When creating single elements use the closing tag or XHTML format. For example, to create a span use $("<span/>") or $("<span></span>") instead of without the closing slash/tag.
</div>
</div>
<h2>返回值</h2>
<p class="indent">jQuery</p>
<h2>参数</h2>
<p class="indent"><strong>html </strong>(String) : 用于动态创建DOM元素的HTML标记字符串</p>
<h2>示例</h2>
<p class="indent">
动态创建一个 div 元素(以及其中的所有内容),并将它追加到 body 元素中。在这个函数的内部,是通过临时创建一个元素,并将这个元素的 innerHTML 属性设置为给定的标记字符串,来实现标记到 DOM 元素转换的。所以,这个函数既有灵活性,也有局限性。
</p>
<p class="indent"><strong>jQuery 代码:</strong></p>
<div class="code">
$("<div><p>Hello</p></div>").appendTo("body");
</div>
<hr />
<p class="indent">
创建一个 <input> 元素必须同时设定 type 属性。因为微软规定 <input> 元素的 type 只能写一次。</p>
<p class="indent"><strong>jQuery 代码:</strong></p>
<div class="code">
// 在 IE 中无效:<br/>
$("<input>").attr("type", "checkbox");<br/>
// 在 IE 中有效:<br/>
$("<input type='checkbox'>");<br/>
</div>
</div>
<div
没有合适的资源?快使用搜索试试~ 我知道了~
学习AJAX的框架Jquery1.2以及Jquery1.2的API
共13个文件
png:5个
js:4个
css:1个
需积分: 0 1 下载量 62 浏览量
2008-11-20
13:01:57
上传
评论
收藏 96KB RAR 举报
温馨提示
很好的ajax框架,用起来方便,很容易上手
资源详情
资源评论
资源推荐
收起资源包目录
jqueryAPI1.2.rar (13个子文件)
jqueryAPI1.2
JQUERY 扩展_我要做动画.mht 124KB
index.html 320KB
style
jqueryapi.js 3KB
jqueryapi.css 2KB
img
.png 899B
menuitem.png 569B
123.png 569B
functionitem.png 862B
favicon.ico 1KB
categoryitem.png 836B
lib
jquery.corner-min.js 3KB
jquery.js 29KB
jquery.dimensions.js 4KB
共 13 条
- 1
fengfeng925
- 粉丝: 18
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0