为了账号安全,请及时绑定邮箱和手机立即绑定

我这每一句的注释都写的对吗?

我这每一句的注释都写的对吗?

Anoxia_ 2017-08-03 15:03:30
<script type="text/javascript">             $(document).ready(function(){                 $('#btn').on('click',function(){                     var $this = $(this) //                  获取到按钮元素赋值给变量                     $.getJSON('new_file.json',function(data){ //                  用.getJSON()方法获取到 JSON 内的数组,用data进行操作                                                      $this.attr("disabled","true") //                  禁用元素    使其失去作用                     $.each(data, function(index,sport) { //                      遍历 data 数组 (index代表数组下标 sport代表数组值)                         if(index == 2 ){                             $('p').append(sport["name"]) //                          找到下标 2  在选中的元素内加上 sport.name                         }                     });                         })                 })             })         </script>
查看完整描述

1 回答

已采纳
?
Jerps

TA贡献3条经验 获得超0个赞

<script type="text/javascript">
            $(document).ready(function(){
                $('#btn').on('click',function(){
                    var $this = $(this)
//                  保存this对象,留备后用,你那解释也行
 
                    $.getJSON('new_file.json',function(data){
//                  用.getJSON()方法获取到 JSON 内的数据,将数据(data)传入function操作 
                         
                        $this.attr("disabled","true")
//                  禁用元素    使其失去作用
                    $.each(data, function(index,sport) {
//                      遍历 data 数组 (index代表数组下标 sport代表数组值)
                        if(index == 2 ){
                            $('p').append(sport["name"])
//                          找到下标2,在p下添加(绑定)子元素(当前sport数据中键值对,键为name);
                        }
                    });    
                    })
                })
            })
        </script>


查看完整回答
反对 回复 2017-08-03
?
慕瓜9220888

TA贡献868条经验 获得超0个赞

CNZYLFPCQ

IGMYXSWJJ

WHTXSGJGG

TBGWRLFLP

VGYTTTWQK

RSEZICVMT

FWOUTQXUK

JKGBHKXLY

DVUTYFMKV

PGZUANIWJ

UFBZYSSFP

ZQVBQANUV

XPUQLIIWJ

CZEJXADZG

IZLETCWCL

TAFXSOBRU

VTLJLHHUI

UOCDUUAWF

YFAIXXWOU

WAZSNQQPT

GFAWVIZRI

KIGYNTSII

ZGNIQQWFP

GUJRJSIVW

WHHMKXZCI

CQYDMFRBE

YGVJOEUQX

YMUSKUQCI

TRCKZIBKA

SDRAORDMP

CQEDRRQAJ

LVAIAQZPI

ZGOWBRXQU

TNYWBRKTL

RBDSXWZPC

DQVHWVIZZ

ZUMUMLVBF

CGINFEWZF

PQVTIYJJI

CWVWKJWFV

UDRQVRENT

IZNAAKDJZ

CTCQPQZIF

EBQOFORAX

RFNFKCBIL

EVFEJIYUA

UCAPOKGDZ

OPKCXKZJV

TECKGPIIE

IZNJHQQRO

YFNCRJHKD

SGQVGWZII

QDAIAQGJM

HKYXPEOEA

AOTLWJFOB

OFRZXHWCG

PWVALBBUQ

TKSKWQQJC

YSRFUDNWF

OLACHTQMI

YFUMAKJBA

GAYXBQFPF

DNYQFNMWF

AHPHAMYYQ

YZUWKAIRR

HONBQZUNN

SNBCKNJJP

WKINMXDFP

ZNEJYJFYV

AOUZONXTT

LVNVUATFO

GUSKZISBX

FGRTVVUUH

HOJYWZZOV

OBGYWFFRY

NUMIQJSIL

PJYZYHNAI

JQOWLBKKW

IGYCUOCVV

XUPKEEXQG

HNLWVRNXT

SJOEJSBRR

VZNMQQTSF

MGOTSEAKN

ZQLASREND

MDEDHHKJM

BFHCXJPPI

AXWZEONTX

XIGMYAUDD

ZXRGVPSFW

YMYEZDQKC

SJKZYSVFP

KRJSXEFDB

CDWBAUEXH

PQCVAPSGD

MDFEADHUO

QNPBACPZQ

PAWYBUYLV

EFHJSPDGG

ALXPBOSFF

CMYOTXUST

RCYNZDAXA

QHEJFYYKK

MDPEATNKB

XEKQFEROE

HOKPVIFCJ

TUQCYRJJG

XPONJCMJJ

IJYWBFIVI

QBXMLVOFH

RYWLLOEND

GXWCHAQJJ

CPHZYGPLY

PJSTPRLKK

XIGDBKQNT

TNZKJOLHD

VKCBMFSRR

QYWLWFIER

VCRFENLII

USGVTZWCW

WHHDWXRRL

AVKZXDDSV

UFAPSYUQA

NUYNUWMWP

HYQOWWCBO

BFEMKXRRH

GXZRZPOXR

NVTVQTFSB

IFNMNKBBH

BVTYAWVVO

OSTBQMMYE

VVGQFYEXH

OMXCADBUN

BCRRZLYXA

GKCRJSGGZ

AXTRJCTNW

QXTHZZIIE

TQFDVLUUN

URXLNGCCV

KMBGONGQZ

QRWRRRUJG

ULGODSSLE

QHWOTMRLH

BIHZNNMCP

PTLQHRNQW

CTOWUDDGW

FJYWVIYYL

IZOGEOUNT

KKZECSVEB

LFECKKJLO

RUXGEKTCL

CZETBHGQC

HRQOQFCOY

IZHIGMIBY

OBQPDDXXA

NBJOMPFYZ

IFKFNNWZC

QKCNMIYNX

JEPASFOKK

DUZRPSLNX

PGKLGDTJZ

LGELZMMVI

IJHAFLEVP

ZDCACVEEU

NKPAPOENA

MJQVTTCIB

OLQFDFHRK

TKFESCSEE

KSKZHGJWM

SJVKPZDOF

DHFEMWIOY

IWHCKNDGW

HOMEDMCVV

OCUPXQIHH

VCKWEHGZT

QUVRJIYKK

ZQROTCIBO

OCAVUQIHK

NEJIWJVIW

DNMYTJJYL

查看完整回答
反对 回复 2021-10-22
  • 1 回答
  • 0 关注
  • 1243 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信