Skip to content

Commit 047e7e5

Browse files
committed
修改页面模式
1 parent e79e391 commit 047e7e5

File tree

3 files changed

+138
-134
lines changed

3 files changed

+138
-134
lines changed

index.zh_CN.xsl

+10-4
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@
6565
<xsl:sort select="@name"/>
6666
<xsl:choose>
6767
<xsl:when test="@type='selector'">
68-
<xsl:result-document href="./dist/entry/{replace(@name,' ','-')}-selector.html">
68+
<xsl:result-document href="./dist/{replace(@name,' ','-')}-selector.htm">
6969
<xsl:apply-templates select="current-group()"/>
7070
</xsl:result-document>
7171
</xsl:when>
7272
<xsl:otherwise>
73-
<xsl:result-document href="./dist/entry/{@name}.html">
73+
<xsl:result-document href="./dist/{@name}.htm">
7474
<xsl:apply-templates select="current-group()"/>
7575
</xsl:result-document>
7676
</xsl:otherwise>
@@ -85,7 +85,7 @@
8585
$(window).hashchange(function(){
8686
var page=window.location.hash.replace("#","")||"cheatsheet";
8787
$("#content").empty().css("top",$(document).scrollTop())
88-
.load("entry/"+page+".html?"+(new Date/86400000).toFixed(0),function(){
88+
.load("entry/"+page+".htm?"+(new Date/86400000).toFixed(0),function(){
8989
$("iframe").each(function(){
9090
var doc = this.contentDocument ||
9191
(iframe.contentWindow && iframe.contentWindow.document) ||
@@ -103,11 +103,17 @@
103103
});
104104
$("#sidebar li").click(function(){
105105
if($(this).hasClass("selector")){
106-
window.location.hash==$(this).attr("title").replace(" ","-")+"-selector";
106+
window.location.hash=$(this).attr("title").replace(" ","-")+"-selector";
107107
}else{
108108
window.location.hash=$(this).text().replace("()","");
109109
}
110110
});
111+
$("#content").click(function(e){
112+
if($(e.target).is("a[href$='.htm']")){
113+
window.location.hash=$(e.target).attr("href").replace(".htm","");
114+
return false;
115+
}
116+
});
111117
]]></script>
112118
<script type="text/javascript">
113119

jQueryAPI.en_US.xml

+28-28
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
<category name="Version 1.1"/>
8484
<category name="Version 1.0.4"/>
8585
<category name="Version 1.0"/>
86-
</category>
86+
</category>
8787
</categories>
8888
<entries>
8989
<entry type='method' name="fadeToggle" return="jQuery">
@@ -8143,30 +8143,30 @@ $('div.foo').click(function() {
81438143
<h4 id="cloning-jquery-objects">Cloning jQuery Objects</h4>
81448144
<p>When a jQuery object is passed as a parameter to the <code>$()</code> function, a clone of the object is created. This new jQuery object references the same DOM elements as the initial one.</p>
81458145
<h4 id="returning-empty-set">Returning an Empty Set</h4>
8146-
<p>As of jQuery 1.4, calling the <code>jQuery()</code> method with <em>no arguments</em> returns an empty jQuery set. In previous versions of jQuery, this would return a set containing the document node.</p>
8146+
<p>As of jQuery 1.4, calling the <code>jQuery()</code> method with <em>no arguments</em> returns an empty jQuery set (with a <code><a href="http://api.jquery.com/length/">.length</a></code> property of 0). In previous versions of jQuery, this would return a set containing the document node.</p>
81478147
</longdesc>
8148-
<example>
8149-
<desc>Finds all p elements that are children of a div element.</desc>
8150-
<code><![CDATA[$("div > p").css("border", "1px solid gray");]]></code>
8151-
<html><![CDATA[<p>one</p> <div><p>two</p></div> <p>three</p>]]></html>
8152-
<results><![CDATA[[ <p>two</p> ] ]]></results>
8153-
</example>
8154-
<example>
8155-
<desc>Finds all inputs of type radio within the first form in the document.</desc>
8156-
<code><![CDATA[$("input:radio", document.forms[0]);]]></code>
8157-
</example>
8158-
<example>
8159-
<desc>Finds all div elements within an XML document from an Ajax response.</desc>
8160-
<code><![CDATA[$("div", xml.responseXML);]]></code>
8161-
</example>
8162-
<example>
8163-
<desc>Sets the background color of the page to black.</desc>
8164-
<code><![CDATA[$(document.body).css( "background", "black" );]]></code>
8165-
</example>
8166-
<example>
8167-
<desc>Hides all the input elements within a form.</desc>
8168-
<code><![CDATA[$(myForm.elements).hide()]]></code>
8169-
</example>
8148+
<example>
8149+
<desc>Finds all p elements that are children of a div element.</desc>
8150+
<code><![CDATA[$("div > p").css("border", "1px solid gray");]]></code>
8151+
<html><![CDATA[<p>one</p> <div><p>two</p></div> <p>three</p>]]></html>
8152+
<results><![CDATA[[ <p>two</p> ] ]]></results>
8153+
</example>
8154+
<example>
8155+
<desc>Finds all inputs of type radio within the first form in the document.</desc>
8156+
<code><![CDATA[$("input:radio", document.forms[0]);]]></code>
8157+
</example>
8158+
<example>
8159+
<desc>Finds all div elements within an XML document from an Ajax response.</desc>
8160+
<code><![CDATA[$("div", xml.responseXML);]]></code>
8161+
</example>
8162+
<example>
8163+
<desc>Sets the background color of the page to black.</desc>
8164+
<code><![CDATA[$(document.body).css( "background", "black" );]]></code>
8165+
</example>
8166+
<example>
8167+
<desc>Hides all the input elements within a form.</desc>
8168+
<code><![CDATA[$(myForm.elements).hide()]]></code>
8169+
</example>
81708170
<category name="Core"/>
81718171
<category name="Version 1.0"/>
81728172
<category name="Version 1.4"/>
@@ -9178,7 +9178,7 @@ button { float:left; margin:5px 10px 5px 0; }
91789178
</argument>
91799179
</signature>
91809180
<desc>Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.</desc>
9181-
<longdesc><p>Given a jQuery object that represents a set of DOM elements, the <code>.parents()</code> method allows us to search through the ancestors of these elements in the DOM tree and construct a new jQuery object from the matching elements ordered from immediate parent on up; the elements are returned in order from the closest parent to the outer ones. The <code>.parents()</code> and <code>.parent()</code> methods are similar, except that the latter only travels a single level up the DOM tree.</p>
9181+
<longdesc><p>Given a jQuery object that represents a set of DOM elements, the <code>.parents()</code> method allows us to search through the ancestors of these elements in the DOM tree and construct a new jQuery object from the matching elements ordered from immediate parent on up; the elements are returned in order from the closest parent to the outer ones. The <code>.parents()</code> and <code><a href="http://api.jquery.com/parent/">.parent()</a></code> methods are similar, except that the latter only travels a single level up the DOM tree.</p>
91829182
<p>The method optionally accepts a selector expression of the same type that we can pass to the <code>$()</code> function. If the selector is supplied, the elements will be filtered by testing whether they match it.</p>
91839183
<p>Consider a page with a basic nested list on it:</p>
91849184
<pre>
@@ -10686,7 +10686,7 @@ alert("The last 25 entries in the feed have been loaded");
1068610686

1068710687
<h4 id="sending-data-to-server">Sending Data to the Server</h4>
1068810688
<p>By default, Ajax requests are sent using the GET HTTP method. If the POST method is required, the method can be specified by setting a value for the <code>type</code> option. This option affects how the contents of the <code>data</code> option are sent to the server. POST data will always be transmitted to the server using UTF-8 charset, per the W3C XMLHTTPRequest standard.</p>
10689-
<p>The <code>data</code> option can contain either a query string of the form <code>key1=value1&amp;key2=value2</code>, or a map of the form <code>{key1: 'value1', key2: 'value2'}</code>. If the latter form is used, the data is converted into a query string before it is sent. This processing can be circumvented by setting <code>processData</code> to <code>false</code>. The processing might be undesirable if we wish to send an XML object to the server; in this case, we would also want to change the <code>contentType</code> option from <code>application/x-www-form-urlencoded</code> to a more appropriate MIME type.</p>
10689+
<p>The <code>data</code> option can contain either a query string of the form <code>key1=value1&amp;key2=value2</code>, or a map of the form <code>{key1: 'value1', key2: 'value2'}</code>. If the latter form is used, the data is converted into a query string using <code><a href="http://api.jquery.com/jQuery.param/">jQuery.param()</a></code> before it is sent. This processing can be circumvented by setting <code>processData</code> to <code>false</code>. The processing might be undesirable if we wish to send an XML object to the server; in this case, we would also want to change the <code>contentType</code> option from <code>application/x-www-form-urlencoded</code> to a more appropriate MIME type.</p>
1069010690

1069110691
<h4 id="advanced-options">Advanced Options</h4>
1069210692
<p>The <code>global</code> option prevents handlers registered using <code><a href="/ajaxSend">.ajaxSend()</a></code>, <code><a href="/ajaxError">.ajaxError()</a></code>, and similar methods from firing when this request would trigger them. This can be useful to, for example, suppress a loading indicator that was implemented with <code><a href="/ajaxSend">.ajaxSend()</a></code> if the requests are frequent and brief. See the descriptions of these methods below for more details.</p>
@@ -18410,6 +18410,6 @@ $( "#dramaBtn" ).click( function() {
1841018410

1841118411
Minified using disk
1841218412
Page Caching using disk (enhanced)
18413-
Database Caching 18/28 queries in 0.122 seconds using disk
18413+
Database Caching 16/28 queries in 0.083 seconds using disk
1841418414

18415-
Served from: api.jquery.com @ 2010-11-27 18:11:13 -->
18415+
Served from: api.jquery.com @ 2010-11-28 07:49:51 -->

0 commit comments

Comments
 (0)