19 Matching Annotations
  1. May 2022
    1. The focus event does not bubble in Internet Explorer. Therefore, scripts that rely on event delegation with the focus event will not work consistently across browsers. As of version 1.4.2, however, jQuery works around this limitation by mapping focus to the focusin event in its event delegation methods, .live() and .delegate().
    1. jquery绑定input的change事件 背景:在做一个登录页时,如果用户未输入验证码则无法点击登录按钮,所以想到了用input的change事件,但是在写完后发现无法监听input值的改变。 解决办法:改为了input事件
    1. $('input[name=myInput]').change(function() { ... });1. 在输入框内容变化的时候不会触发change,当鼠标在其他地方点一下才会触发

      $("input").change(function(e) { // ... });

      $("input").on('input', function(e) { // ....})

  2. Apr 2022
    1. could a few carefully-placed lines of jQuery

      Look, jQuery is not lightweight.* It's how we got into this mess.

      * Does it require half a gigabyte of dev dependencies and regular dependencies to create a Hello, World application? No, but it's still not lightweight.

  3. Feb 2022
    1. only jquery

      It would be nice if people would stop saying this—and saying it like this—as if it's a badge of honor. jQuery is a fuckin' beast. 10 years ago, the reason that the browser was being brought to a crawl on any given pages often came down to the fact that it was using jQuery. jQuery is the reason that bloated frameworks became normalized and brought us to where we are today. So, enough already with this just-a-little-jQuery stuff.

  4. Nov 2021
    1. You can stop the loop from within the callback function by returning false.

      Ritornare false da una funzione di callback all'interno di un metodo each provoca l'interruzione del loop.

  5. May 2021
    1. Are you also tired and fed up with the bulkiness of jQuery, but also don't want to have to type document.querySelector("div").appendChild(document.createTextNode("hello")); just to add some text to an element?

      happy middle/medium?

  6. Jan 2020
  7. Dec 2019
    1. If you are using a JavaScript library, chances are it comes with a client HTTP API. jQuery’s $.ajax() function, for example, has been particularly popular with frontend developers. But as developers move away from such libraries in favor of native APIs, dedicated HTTP clients have emerged to fill the gap.
  8. Jan 2017
    1. var jq = document.createElement('script'); jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"; document.getElementsByTagName('head')[0].appendChild(jq); // ... give time for script to load, then type (or see below for non wait option) jQuery.noConflict();

      Add jQuery in the console!

  9. Jul 2016
    1. $("#q").on("typeahead:selected", function(eventObject, suggestion, name)

      The event handler will be invoked with 3 arguments: the jQuery event object, the suggestion object, and the name of the dataset the suggestion belongs to.

    1. #registration

      same as CSS, # refers to element ID

    2. input

      which child element do you want to manipulate, separated with a space

    3. [name=confirmation]

      like an associative array, looking for where the attribute name = confirmation

  10. Jun 2016
    1. If .ready() is called after the DOM has been initialized, the new handler passed in will be executed immediately.