久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    <bdo id='1sraq'></bdo><ul id='1sraq'></ul>

<legend id='1sraq'><style id='1sraq'><dir id='1sraq'><q id='1sraq'></q></dir></style></legend>

<small id='1sraq'></small><noframes id='1sraq'>

  1. <tfoot id='1sraq'></tfoot>

      <i id='1sraq'><tr id='1sraq'><dt id='1sraq'><q id='1sraq'><span id='1sraq'><b id='1sraq'><form id='1sraq'><ins id='1sraq'></ins><ul id='1sraq'></ul><sub id='1sraq'></sub></form><legend id='1sraq'></legend><bdo id='1sraq'><pre id='1sraq'><center id='1sraq'></center></pre></bdo></b><th id='1sraq'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='1sraq'><tfoot id='1sraq'></tfoot><dl id='1sraq'><fieldset id='1sraq'></fieldset></dl></div>

      如何使用帶有 jQ??uery 的 change() 方法的參數的

      How to use a function that takes arguments with jQuery#39;s change() method?(如何使用帶有 jQ??uery 的 change() 方法的參數的函數?)
    1. <legend id='6BXAn'><style id='6BXAn'><dir id='6BXAn'><q id='6BXAn'></q></dir></style></legend>
    2. <i id='6BXAn'><tr id='6BXAn'><dt id='6BXAn'><q id='6BXAn'><span id='6BXAn'><b id='6BXAn'><form id='6BXAn'><ins id='6BXAn'></ins><ul id='6BXAn'></ul><sub id='6BXAn'></sub></form><legend id='6BXAn'></legend><bdo id='6BXAn'><pre id='6BXAn'><center id='6BXAn'></center></pre></bdo></b><th id='6BXAn'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='6BXAn'><tfoot id='6BXAn'></tfoot><dl id='6BXAn'><fieldset id='6BXAn'></fieldset></dl></div>

            <small id='6BXAn'></small><noframes id='6BXAn'>

            • <bdo id='6BXAn'></bdo><ul id='6BXAn'></ul>
                <tbody id='6BXAn'></tbody>
            • <tfoot id='6BXAn'></tfoot>

                本文介紹了如何使用帶有 jQ??uery 的 change() 方法的參數的函數?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我正在使用 jQuery 1.5 版.我在看 jQuery 的 change() 函數特別是在這一點:

                I'm using jQuery version 1.5. I am looking at jQuery's change() function and specifically at this bit:

                .change( [ eventData ], handler(eventObject) )
                eventData: A map of data that will be passed to the event handler.
                handler(eventObject): A function to execute each time the event is triggered.
                

                JavaScript 中的數據映射"到底是什么?如何使用以下測試函數作為事件處理程序?

                What exactly is a "map of data" in JavaScript? How can I use the following test function as an event handler?

                var myHandler = function(msg){alert(msg);};
                

                我試過了:

                $("select#test").change(["ok"], myHandler);
                

                并且警報報告 [object Object]

                and the alert reports [object Object]

                推薦答案

                參見event.data.數據不會作為參數傳遞給處理程序,而是作為事件對象的屬性:

                See event.data. The data is not passed as argument to handler, but as property of the event object:

                $("select#test").change({msg: "ok"},  function(event) {
                    alert(event.data.msg);
                });
                

                處理程序始終只接受一個參數,即 event 對象.這就是您的警報顯示 "[object Object]" 的原因,您的函數正在打印事件對象.
                如果你想使用帶有自定義參數的函數,你必須將它們包裝到另一個函數中:

                The handler always only accepts one argument, which is the event object. This is the reason why your alert shows "[object Object]", your function is printing the event object.
                If you want to use functions with custom arguments, you have to wrap them into another function:

                $("select#test").change({msg: "ok"},  function(event) {
                    myHandler(event.data.msg);
                });
                

                或者只是

                $("select#test").change(function(event) {
                    myHandler("ok");
                });
                

                <小時>

                順便說一句.選擇器最好寫成 $('#test').ID 是(應該)唯一的.無需在標簽名稱前添加.


                Btw. the selector is better written as $('#test'). IDs are (should be) unique. There is no need to prepend the tag name.

                這篇關于如何使用帶有 jQ??uery 的 change() 方法的參數的函數?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Use IScroll in Angular 2 / Typescript(在 Angular 2/Typescript 中使用 IScroll)
                anime.js not working in Ionic 3 project(Anime.js 在 Ionic 3 項目中不起作用)
                Ionic 3 - Update Observable with Asynchronous Data(Ionic 3 - 使用異步數據更新 Observable)
                Angular 2: file not found on local .json file(Angular 2:在本地 .json 文件中找不到文件)
                In Ionic 2, how do I create a custom directive that uses Ionic components?(在 Ionic 2 中,如何創建使用 Ionic 組件的自定義指令?)
                Use ViewChild for dynamic elements - Angular 2 amp; ionic 2(將 ViewChild 用于動態元素 - Angular 2 amp;離子2)
                  <tbody id='yRHof'></tbody>

                  <small id='yRHof'></small><noframes id='yRHof'>

                        <tfoot id='yRHof'></tfoot>
                          <bdo id='yRHof'></bdo><ul id='yRHof'></ul>

                        • <i id='yRHof'><tr id='yRHof'><dt id='yRHof'><q id='yRHof'><span id='yRHof'><b id='yRHof'><form id='yRHof'><ins id='yRHof'></ins><ul id='yRHof'></ul><sub id='yRHof'></sub></form><legend id='yRHof'></legend><bdo id='yRHof'><pre id='yRHof'><center id='yRHof'></center></pre></bdo></b><th id='yRHof'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='yRHof'><tfoot id='yRHof'></tfoot><dl id='yRHof'><fieldset id='yRHof'></fieldset></dl></div>
                          <legend id='yRHof'><style id='yRHof'><dir id='yRHof'><q id='yRHof'></q></dir></style></legend>
                          主站蜘蛛池模板: 伊人在线视频 | 免费成人高清在线视频 | 黄网免费 | 亚洲一区二区在线播放 | 亚洲国产成人精品女人久久久 | 天堂一区二区三区 | 国产日韩欧美激情 | 日韩av网址在线观看 | 狠狠色综合欧美激情 | 国产美女一区二区三区 | 精品美女视频在免费观看 | 国产成人精品午夜 | 久久精品亚洲精品 | 久久久无码精品亚洲日韩按摩 | 91免费在线看 | 亚洲欧美日韩久久 | 粉嫩一区二区三区国产精品 | 亚洲国产中文字幕 | 卡通动漫第一页 | 91久久精品一区 | 亚洲精品中文在线 | 国产电影一区二区在线观看 | 国产一区二区精品在线 | av在线播放一区二区 | 天天av天天好逼 | 国产日韩欧美91 | 麻豆国产精品777777在线 | 91亚洲精品国偷拍自产在线观看 | 日本黄色免费大片 | 久久久影院| 日本一区二区三区四区 | 国产一区二区日韩 | 中午字幕在线观看 | 欧美精品一二区 | 日韩成人在线观看 | 久草免费在线视频 | 国产精品一二区 | 秋霞a级毛片在线看 | 午夜免费av | 四虎永久免费地址 | www国产成人免费观看视频 |