From 69e45e3ead444e5ddfc6881d90a21d66f4a42016 Mon Sep 17 00:00:00 2001 From: Arthur Verschaeve Date: Sat, 28 Mar 2015 18:19:15 +0100 Subject: [PATCH] All: fix some broken links --- entries/contents.xml | 2 +- entries/delay.xml | 2 +- entries/html.xml | 2 +- entries/id-selector.xml | 2 +- entries/jQuery.ajax.xml | 2 +- entries/odd-selector.xml | 2 +- entries/triggerHandler.xml | 2 +- entries/val.xml | 2 +- pages/Types.html | 10 +++++----- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/entries/contents.xml b/entries/contents.xml index d10defc0..9f4d8b2f 100644 --- a/entries/contents.xml +++ b/entries/contents.xml @@ -33,7 +33,7 @@ $( ".container" ) .filter( "br" ) .remove(); -

This code first retrieves the contents of <div class="container"> and then filters it for text nodes, which are wrapped in paragraph tags. This is accomplished by testing the .nodeType property of the element. This DOM property holds a numeric code indicating the node's type; text nodes use the code 3. The contents are again filtered, this time for <br /> elements, and these elements are removed.

+

This code first retrieves the contents of <div class="container"> and then filters it for text nodes, which are wrapped in paragraph tags. This is accomplished by testing the .nodeType property of the element. This DOM property holds a numeric code indicating the node's type; text nodes use the code 3. The contents are again filtered, this time for <br /> elements, and these elements are removed.

Find all the text nodes inside a paragraph and wrap them with a bold tag. diff --git a/entries/delay.xml b/entries/delay.xml index 94c9d83d..c94b2a0b 100644 --- a/entries/delay.xml +++ b/entries/delay.xml @@ -21,7 +21,7 @@ $( "#foo" ).slideUp( 300 ).delay( 800 ).fadeIn( 400 );

When this statement is executed, the element slides up for 300 milliseconds and then pauses for 800 milliseconds before fading in for 400 milliseconds.

- The .delay() method is best for delaying between queued jQuery effects. Because it is limited—it doesn't, for example, offer a way to cancel the delay—.delay() is not a replacement for JavaScript's native setTimeout function, which may be more appropriate for certain use cases. + The .delay() method is best for delaying between queued jQuery effects. Because it is limited—it doesn't, for example, offer a way to cancel the delay—.delay() is not a replacement for JavaScript's native setTimeout function, which may be more appropriate for certain use cases.

diff --git a/entries/html.xml b/entries/html.xml index 2fb32ea1..7a4f2594 100644 --- a/entries/html.xml +++ b/entries/html.xml @@ -119,7 +119,7 @@ $( "div.demo-container" ).html(function() {

Given a document with six paragraphs, this example will set the HTML of <div class="demo-container"> to <p>All new content for <em>6 paragraphs!</em></p>.

This method uses the browser's innerHTML property. Some browsers may not generate a DOM that exactly replicates the HTML source provided. For example, Internet Explorer prior to version 8 will convert all href properties on links to absolute URLs, and Internet Explorer prior to version 9 will not correctly handle HTML5 elements without the addition of a separate compatibility layer.

-

To set the content of a <script> element, which does not contain HTML, use the .text() method and not .html().

+

To set the content of a <script> element, which does not contain HTML, use the .text() method and not .html().

Note: In Internet Explorer up to and including version 9, setting the text content of an HTML element may corrupt the text nodes of its children that are being removed from the document as a result of the operation. If you are keeping references to these DOM elements and need them to be unchanged, use .empty().html( string ) instead of .html(string) so that the elements are removed from the document before the new string is assigned to the element.

diff --git a/entries/id-selector.xml b/entries/id-selector.xml index 0bff7166..20aab992 100644 --- a/entries/id-selector.xml +++ b/entries/id-selector.xml @@ -13,7 +13,7 @@

For id selectors, jQuery uses the JavaScript function document.getElementById(), which is extremely efficient. When another selector is attached to the id selector, such as h2#pageTitle, jQuery performs an additional check before identifying the element as a match.

Calling jQuery() (or $()) with an id selector as its argument will return a jQuery object containing a collection of either zero or one DOM element.

Each id value must be used only once within a document. If more than one element has been assigned the same ID, queries that use that ID will only select the first matched element in the DOM. This behavior should not be relied on, however; a document with more than one element using the same ID is invalid.

-

If the id contains characters like periods or colons you have to escape those characters with backslashes.

+

If the id contains characters like periods or colons you have to escape those characters with backslashes.

Select the element with the id "myDiv" and give it a red border. diff --git a/entries/jQuery.ajax.xml b/entries/jQuery.ajax.xml index 428108d4..d7b49447 100644 --- a/entries/jQuery.ajax.xml +++ b/entries/jQuery.ajax.xml @@ -74,7 +74,7 @@ $.ajax({ The type of data that you're expecting back from the server. If none is specified, jQuery will try to infer it based on the MIME type of the response (an XML MIME type will yield XML, in 1.4 JSON will yield a JavaScript object, in 1.4 script will execute the script, and anything else will be returned as a string). The available types (and the result passed as the first argument to your success callback) are: -
  • "xml": Returns a XML document that can be processed via jQuery.
  • "html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM.
  • "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true. Note: This will turn POSTs into GETs for remote-domain requests.
  • "json": Evaluates the response as JSON and returns a JavaScript object. The JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} instead. (See json.org for more information on proper JSON formatting.)
  • "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true.
  • "text": A plain text string.
  • multiple, space-separated values: As of jQuery 1.5, jQuery can convert a dataType from what it received in the Content-Type header to what you require. For example, if you want a text response to be treated as XML, use "text xml" for the dataType. You can also make a JSONP request, have it received as text, and interpreted by jQuery as XML: "jsonp text xml." Similarly, a shorthand string such as "jsonp xml" will first attempt to convert from jsonp to xml, and, failing that, convert from jsonp to text, and then from text to xml. +
    • "xml": Returns a XML document that can be processed via jQuery.
    • "html": Returns HTML as plain text; included script tags are evaluated when inserted in the DOM.
    • "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true. Note: This will turn POSTs into GETs for remote-domain requests.
    • "json": Evaluates the response as JSON and returns a JavaScript object. The JSON data is parsed in a strict manner; any malformed JSON is rejected and a parse error is thrown. As of jQuery 1.9, an empty response is also rejected; the server should return a response of null or {} instead. (See json.org for more information on proper JSON formatting.)
    • "jsonp": Loads in a JSON block using JSONP. Adds an extra "?callback=?" to the end of your URL to specify the callback. Disables caching by appending a query string parameter, "_=[TIMESTAMP]", to the URL unless the cache option is set to true.
    • "text": A plain text string.
    • multiple, space-separated values: As of jQuery 1.5, jQuery can convert a dataType from what it received in the Content-Type header to what you require. For example, if you want a text response to be treated as XML, use "text xml" for the dataType. You can also make a JSONP request, have it received as text, and interpreted by jQuery as XML: "jsonp text xml." Similarly, a shorthand string such as "jsonp xml" will first attempt to convert from jsonp to xml, and, failing that, convert from jsonp to text, and then from text to xml.
    diff --git a/entries/odd-selector.xml b/entries/odd-selector.xml index a2520812..12a75cb8 100644 --- a/entries/odd-selector.xml +++ b/entries/odd-selector.xml @@ -5,7 +5,7 @@ 1.0 - Selects odd elements, zero-indexed. See also even. + Selects odd elements, zero-indexed. See also even.

    In particular, note that the 0-based indexing means that, counter-intuitively, :odd selects the second element, fourth element, and so on within the matched set.

    diff --git a/entries/triggerHandler.xml b/entries/triggerHandler.xml index e174311f..ac6c34ba 100644 --- a/entries/triggerHandler.xml +++ b/entries/triggerHandler.xml @@ -14,7 +14,7 @@ -

    .triggerHandler( eventType ) executes all handlers bound with jQuery for the event type. It will also execute any method called on{eventType}() found on the element. The behavior of this method is similar to .trigger(), with the following exceptions:

    +

    .triggerHandler( eventType ) executes all handlers bound with jQuery for the event type. It will also execute any method called on{eventType}() found on the element. The behavior of this method is similar to .trigger(), with the following exceptions:

    • The .triggerHandler( "event" ) method will not call .event() on the element it is triggered on. This means .triggerHandler( "submit" ) on a form will not call .submit() on the form.
    • While .trigger() will operate on all elements matched by the jQuery object, .triggerHandler() only affects the first matched element.
    • diff --git a/entries/val.xml b/entries/val.xml index bb5f03e2..184abdad 100644 --- a/entries/val.xml +++ b/entries/val.xml @@ -12,7 +12,7 @@ Get the current value of the first element in the set of matched elements.

      The .val() method is primarily used to get the values of form elements such as input, select and textarea. In the case of select elements, it returns null when no option is selected and an array containing the value of each selected option when there is at least one and it is possible to select more because the multiple attribute is present.

      -

      For selects and checkboxes, you can also use the :selected and :checked selectors to get at values, for example:

      +

      For selects and checkboxes, you can also use the :selected and :checked selectors to get at values, for example:

      
       // Get the value from a dropdown select
       $( "select.foo option:selected").val();
      diff --git a/pages/Types.html b/pages/Types.html
      index cd66dd4d..422f6bd6 100644
      --- a/pages/Types.html
      +++ b/pages/Types.html
      @@ -11,7 +11,7 @@
       
       

      JavaScript provides several built-in datatypes. In addition to those, this page documents virtual types like Selectors, enhanced pseudo-types like Events and all and everything you wanted to know about Functions.

      -

      You should be able to try out most of the examples below by just copying them to your browser's JavaScript Console (Chrome, Safari with Develop menu activated, IE 8+) or Firebug console (Firefox). +

      You should be able to try out most of the examples below by just copying them to your browser's JavaScript Console (Chrome, Safari with Develop menu activated, IE 8+) or Firebug console (Firefox).

      Whenever an example mentions that a type defaults to a boolean value, the result is good to know when using that type in a boolean context:

      @@ -296,7 +296,7 @@

      Iteration

      alert( "key is " + [ key ] + ", value is " + obj[ key ] ); }
      -

      Note that for-in-loop can be spoiled by extending Object.prototype (see Object.prototype is verboten) so take care when using other libraries. +

      Note that for-in-loop can be spoiled by extending Object.prototype (see Object.prototype is verboten) so take care when using other libraries.

      jQuery provides a generic each function to iterate over properties of objects, as well as elements of arrays:

      @@ -412,7 +412,7 @@

      Array<Type> Notation

      This indicates that the method doesn't only expect an array as the argument, but also specifies the expected type. The notation is borrowed from Java 5's generics notation (or C++ templates).

      PlainObject

      -

      The PlainObject type is a JavaScript object containing zero or more key-value pairs. The plain object is, in other words, an Object object. It is designated "plain" in jQuery documentation to distinguish it from other kinds of JavaScript objects: for example, null, user-defined arrays, and host objects such as document, all of which have a typeof value of "object." The jQuery.isPlainObject() method identifies whether the passed argument is a plain object or not, as demonstrated below: +

      The PlainObject type is a JavaScript object containing zero or more key-value pairs. The plain object is, in other words, an Object object. It is designated "plain" in jQuery documentation to distinguish it from other kinds of JavaScript objects: for example, null, user-defined arrays, and host objects such as document, all of which have a typeof value of "object." The jQuery.isPlainObject() method identifies whether the passed argument is a plain object or not, as demonstrated below:

      
         var a = [];
      @@ -621,7 +621,7 @@ 

      XMLHttpRequest

      @@ -641,4 +641,4 @@

      Callbacks Object

      XML Document

      A document object created by the browser's XML DOM parser, usually from a string representing XML. XML documents have different semantics than HTML documents, but most of the traversing and manipulation methods provided by jQuery will work with them.

      Assert

      -

      A reference to or instance of the object holding all of QUnit's assertions. See the API documentation for QUnit.assert for details.

      +

      A reference to or instance of the object holding all of QUnit's assertions. See the API documentation for QUnit.assert for details.