Explain "chaining".

Chaining allows us to run multiple jQuery methods (on the same element) within a single statement.like this:
$(selector).doA().doB().doC()

Explain "deferreds".

The Deferred object, introduced in jQuery 1.5, is a chainable utility object created by calling the jQuery.Deferred() method. It can register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function.

The Deferred object is chainable, similar to the way a jQuery object is chainable, but it has its own methods. After creating a Deferred object, you can use any of the methods below by either chaining directly from the object creation or saving the object in a variable and invoking one or more methods on that variable.

Simplely,the deferred object is the salution of callback function and aslo a asynchronous task runner.

What are some jQuery specific optimizations you can implement?

  • selector optimization
  • event delegation
  • Cache jQuery selector results
  • Minimize DOM operations
  • Avoid repeated object creation
  • Stop using jQuery when you only need selectors(you can import selector only)

What does .end() do?

End the most recent filtering operation in the current chain and return the set of matched elements to its previous state.

How, and why, would you namespace a bound event handler?

Event namespacing provides a way to manage specific event handlers. For example, a plugin could namespace its event handlers to make them easier to unbind while still using anonymous functions. To namespace an event, just suffix the event type with a period and a name

Name 4 different values you can pass to the jQuery method.

  • Selector (string)
  • HTML (string)
  • Callback (function)
  • HTMLElement
  • object
  • array
  • element array
  • jQuery Object etc.

What is the effects (or fx) queue?

Show or manipulate the queue of functions to be executed on the matched elements.

What is the difference between .get(), [], and .eq()?

  • .get() return a raw DOM element
  • [] equal .get()
    • .get(index):index could be a negative number
    • [index]:index >=0
  • .eq() return a jquery element

What is the difference between .bind(), .live(), and .delegate()?

  • Using the .bind() method is very costly as it attaches the same event handler to every item matched in your selector.
  • You should stop using the .live() method as it is deprecated and has a lot of problems with it.
  • The .delegate() method gives a lot of "bang for your buck" when dealing with performance and reacting to dynamically added elements.
  • That the new .on() method is mostly syntax sugar that can mimic .bind(), .live(), or .delegate() depending on how you call it.
  • The new direction is to use the new .on method. Get familiar with the syntax and start using it on all your jQuery 1.7+ projects.

What is the difference between $ and $.fn? Or just what is $.fn.

$ = function(){}
$.fn = $.prototype = {};

Optimize this selector: javascript $(".foo div#bar:eq(0)")

$("#bar")

refs:
deferred-object
differences-between-jquery-bind-vs-live-vs-delegate-vs-on
queue

jQuery Questions:Front-end Developer Interview Questions的更多相关文章

  1. Front-end Developer Interview Questions

    Front-end-Developer-Interview-Questions A list of helpful front-end related questions you can use to ...

  2. JS Questions:Front-end Developer Interview Questions

    Explain event delegation Event delegation allows us to attach a single event listener, to a parent e ...

  3. HTML Questions:Front-end Developer Interview Questions

    What's a doctype do? Instruct the browser to render the page. What's the difference between standard ...

  4. General Questions:Front-end Developer Interview Questions

    What did you learn yesterday/this week? Learning Angular. What excites or interests you about coding ...

  5. CSS Questions:Front-end Developer Interview Questions

    Describe what a "reset" CSS file does and how it's useful. What Is A CSS Reset? A CSS Rese ...

  6. WCF学习系列二---【WCF Interview Questions – Part 2 翻译系列】

    http://www.topwcftutorials.net/2012/09/wcf-faqs-part2.html WCF Interview Questions – Part 2 This WCF ...

  7. WCF学习系列三--【WCF Interview Questions – Part 3 翻译系列】

    http://www.topwcftutorials.net/2012/10/wcf-faqs-part3.html WCF Interview Questions – Part 3 This WCF ...

  8. WCF学习系列四--【WCF Interview Questions – Part 4 翻译系列】

    WCF Interview Questions – Part 4   This WCF service tutorial is part-4 in series of WCF Interview Qu ...

  9. 300+ Manual Testing and Selenium Interview Questions and Answers

    Manual testing is a logical approach and automation testing complements it. So both are mandatory an ...

随机推荐

  1. MySQL错误:Every derived table must have its own alias

    Every derived table must have its own alias 派生表都必须有自己的别名 一般在多表查询时,会出现此错误. 因为,进行嵌套查询的时候子查询出来的的结果是作为一个 ...

  2. Redis快速入门:安装、配置和操作

    本文是有关Redis的系列技术文章之一.在之前的文章中介绍了<Redis快速入门:初识Redis>,对Redis有了一个初步的了解.今天继续为大家介绍Redis如何安装.配置和操作. 系列 ...

  3. Individual Project - Word frequency program-11061171-MaoYu

    BUAA Advanced Software Engineering Project:  Individual Project - Word frequency program Ryan Mao (毛 ...

  4. BroadcastReceiver应用详解(转)

    转自: http://blog.csdn.net/liuhe688/article/details/6955668 問渠那得清如許?為有源頭活水來.南宋.朱熹<觀書有感> 据说程序员是最爱 ...

  5. Android的onCreateOptionsMenu()创建菜单Menu详解(转)

    Android一共有三种形式的菜单:            1.选项菜单(optinosMenu)            2.上下文菜单(ContextMenu)            3.子菜单(s ...

  6. Android Studio 一些使用经验

    一.Mac或Win 7 配置环境,以gradle为例 (1).可以在这里找gradle下载,或者去官网啦 Mac添加环境变量: 1.启动Terminal终端 2.输入cd ~/ 进入当前用户的home ...

  7. Android SQLite数据库版本升级原理解析

    Android使用SQLite数据库保存数据,那数据库版本升级是怎么回事呢,这里说一下. 一.软件v1.0 安装v1.0,假设v1.0版本只有一个account表,这时走继承SQLiteOpenHel ...

  8. ORCFILE,ParquetFile,CubeFile使用场景区别

    这个其实是转自杭州第三次spark meetingup,华为的李昆大神的分享. OLAP分析场景 ORC File Parquet File Cube File Full scan one dimen ...

  9. [LintCode] Binary Tree Serialization

    Design an algorithm and write code to serialize and deserialize a binary tree. Writing the tree to a ...

  10. DP+路径 URAL 1029 Ministry

    题目传送门 /* 题意:就是从上到下,找到最短路,输出路径 DP+路径:状态转移方程:dp[i][j] = min (dp[i-1][j], dp[i][j-1], dp[i][j+1]) + a[[ ...