|
296 | 296 | </example>
|
297 | 297 | </entry>
|
298 | 298 | <entry type="method" name="jQuery.error">
|
299 |
| - <desc>Takes a string and throws an exception containing it.</desc> |
| 299 | + <desc>接受一个字符串,并抛出包含这个字符串的异常。</desc> |
300 | 300 | <signature>
|
301 | 301 | <argument name="message">
|
302 |
| - <desc>The message to send out.</desc> |
| 302 | + <desc>将要发出的消息.</desc> |
303 | 303 | </argument>
|
304 | 304 | </signature>
|
305 | 305 | <longdesc>
|
306 |
| - <p>This method exists primarily for plugin developers who wish to override it and provide a better display (or more information) for the error messages.</p> |
| 306 | + <p>这个方法主要是为了让插件开发人员可以重载此方法,并以更好的方式显示错误消息,或者提供更多相关信息。</p> |
307 | 307 | </longdesc>
|
308 | 308 | <example>
|
309 |
| - <desc>Override jQuery.error for display in Firebug.</desc> |
| 309 | + <desc>重载 jQuery.error 以便可以在 Firebug 中显示。</desc> |
310 | 310 | </example>
|
311 | 311 | </entry>
|
312 | 312 | <entry type="method" name="jQuery.parseJSON">
|
313 |
| - <desc>Takes a well-formed JSON string and returns the resulting JavaScript object.</desc> |
| 313 | + <desc>接受一个标准格式的 JSON 字符串,并返回解析后的 JavaScript 对象。</desc> |
314 | 314 | <signature>
|
315 | 315 | <argument name="json">
|
316 |
| - <desc>The JSON string to parse.</desc> |
| 316 | + <desc>将要解析的 JSON 字符串。</desc> |
317 | 317 | </argument>
|
318 | 318 | </signature>
|
319 | 319 | <longdesc>
|
320 |
| - <p>Passing in a malformed JSON string may result in an exception being thrown. For example, the following are all malformed JSON strings:</p> |
| 320 | + <p>传入格式有误的 JSON 字符串可能导致抛出异常。例如,下面这些 JSON 字符串格式都不对:</p> |
321 | 321 | <ul>
|
322 | 322 | <li>
|
323 |
| - <code>{test: 1}</code> (test does not have double quotes around it).</li> |
| 323 | + <code>{test: 1}</code> (test 没有使用双引号包裹).</li> |
324 | 324 | <li>
|
325 |
| - <code>{'test': 1}</code> ('test' is using single quotes instead of double quotes).</li> |
| 325 | + <code>{'test': 1}</code> ('test' 用了单引号而不是双引号包裹).</li> |
326 | 326 | </ul>
|
327 |
| - <p>Additionally if you pass in nothing, an empty string, null, or undefined, 'null' will be returned from parseJSON. Where the browser provides a native implementation of <code>JSON.parse</code>, jQuery uses it to parse the string. For details on the JSON format, see <a href="http://json.org/">http://json.org/</a>. |
| 327 | + <p>另外,如果你什么都不传入,或者传入空字符串、null、undefined 等,parseJSON 都会返回 null 。如果浏览器原生实现了 <code>JSON.parse</code>, jQuery 则会使用它来解析字符串。更多关于JSON格式的细节请参考 <a href="http://json.org/">http://json.org/</a> |
328 | 328 | </p>
|
329 | 329 | </longdesc>
|
330 | 330 | <example>
|
331 |
| - <desc>Parse a JSON string.</desc> |
| 331 | + <desc>解析一个 JSON 字符串。</desc> |
332 | 332 | </example>
|
333 | 333 | </entry>
|
334 | 334 | <entry type="method" name="jQuery.proxy">
|
335 |
| - <desc>Takes a function and returns a new one that will always have a particular context.</desc> |
| 335 | + <desc>接受一个函数,然后返回一个新函数,并且这个新函数始终保持了特定的上下文语境。</desc> |
336 | 336 | <signature>
|
337 | 337 | <argument name="function">
|
338 |
| - <desc>The function whose context will be changed.</desc> |
| 338 | + <desc>将要改变上下文语境的函数。</desc> |
339 | 339 | </argument>
|
340 | 340 | <argument name="context">
|
341 |
| - <desc>The object to which the context (`this`) of the function should be set.</desc> |
| 341 | + <desc>函数的上下文语境(`this`)会被设置成这个 object 对象。</desc> |
342 | 342 | </argument>
|
343 | 343 | </signature>
|
344 | 344 | <signature>
|
345 | 345 | <argument name="context">
|
346 |
| - <desc>The object to which the context of the function should be set.</desc> |
| 346 | + <desc>函数的上下文语境会被设置成这个 object 对象。</desc> |
347 | 347 | </argument>
|
348 | 348 | <argument name="name">
|
349 |
| - <desc>The name of the function whose context will be changed (should be a property of the 'context' object.</desc> |
| 349 | + <desc>将要改变上下文语境的函数名(这个函数必须是前一个参数 'context' 对象的属性)</desc> |
350 | 350 | </argument>
|
351 | 351 | </signature>
|
352 | 352 | <longdesc>
|
353 |
| - <p>This method is most useful for attaching event handlers to an element where the context is pointing back to a different object. Additionally, jQuery makes sure that even if you bind the function returned from jQuery.proxy() it will still unbind the correct function, if passed the original.</p> |
| 353 | + <p>这个方法通常在向一个元素上附加事件处理函数时,上下文语境实际是指向另一个对象的情况下使用。另外,jQuery 能够确保即使你绑定的函数是经过 jQuery.proxy() 处理过的函数,你依然可以用原先的函数来正确地取消绑定。</p> |
354 | 354 | </longdesc>
|
355 | 355 | <example>
|
356 |
| - <desc>Enforce the context of the function.</desc> |
| 356 | + <desc>强制修改函数的上下文语境</desc> |
357 | 357 | </example>
|
358 | 358 | </entry>
|
359 | 359 | <entry type="method" name="focusout">
|
|
0 commit comments