第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

JS代碼糾錯(cuò)問(wèn)題,瀏覽器糾錯(cuò)如下,求幫忙。

JS代碼糾錯(cuò)問(wèn)題,瀏覽器糾錯(cuò)如下,求幫忙。

KokoTa 2015-09-01 23:09:33
糾錯(cuò)地方為stopPropagation:function(event){ 行中顯示錯(cuò)誤為 Uncaught?SyntaxError:?Unexpected?token?: 感覺(jué)沒(méi)有出錯(cuò)啊??:號(hào)哪里錯(cuò)了? 糾錯(cuò)不能,望指教??!萬(wàn)分感謝??! 我是抄h(huán)ttp://idcbgp.cn/video/2140中老師的代碼,但是就是顯示不出來(lái)。。。 <!DOCTYPE?html> <html> <head> ????<title>事件流</title> ????<meta?charset="utf-8"> ????<script> ?????var?eventUtil={ ????????//添加句柄,兼容 ????????addHandler:function(element,type,hander){//創(chuàng)建一個(gè)句柄,括號(hào)里是對(duì)象,處理事件方式,調(diào)用的函數(shù) ????????if(element.addEventListener) ????????{ ????????????element.addEventListener(type,hander,false); ????????} ????????else?if(element.attachEvent) ????????{ ????????????element.attachEvent('on'+type,hander); ????????} ????????else ????????{ ????????????element['on'+click]?=?hander; ????????} ????????},//記得加逗號(hào)?。?????????//刪除兼容 ????????removeHandler:function(element,type,hander){ ????????if(element.removeEventListener) ????????{ ????????????element.removeEventListener(type,hander,false); ????????} ????????else?if(element.detachEvent) ????????{ ????????????element.detachEvent('on'+type,hander); ????????} ????????else ????????{ ????????????element['on'+click]?=?null; ????????} ????????}, ????????getEvent:function(event){ ????????????return?event?event:window.event; ????????}, ????????getType:function(event){ ????????????return?event.type; ????????}, ????????getElement:function(event){ ????????????return?event.target||event.srcElement; ????????}, ????????preventDefault:function(event){ ????????????if(event.preventDefault) ????????????{ ????????????????event.preventDefault(); ????????????} ????????????else ????????????{ ????????????????event.returnValue=false; ????????????} ????????????} ????????}, ????????stopPropagation:function(event){ ????????????if(event.stopPropagation) ????????????{ ????????????????event.stopPropagation(); ????????????} ????????????else ????????????{ ????????????????event,cancelBubble?=?true; ????????????} ????????} ????????} ???????? } window.onload=function?(){ ????var?go=document.getElementById('go'), ????????box=document.getElementById('box'); ???? ????eventUtil.addHandler(box,'click',function(){ ????????alert('我是個(gè)父盒子'); ????}); ????eventUtil.addHandler(go,'click',function(e){ ????????e=eventUtil.getEvent(e); ????????alert(eventUtil.getElement(e)); ????????eventUtil.preventDefault(e); ????????eventUtil.stopPropagation(e); ????}); } </script> </head> <body> ????<div?id="box"> ????????<input?type="button"?value="按鈕"?id="btn"> ????????<input?type="button"?value="按鈕2"?id="btn2"> ????????<input?type="button"?value="按鈕3"?id="btn3"> ????????<a?href="event.html"?id="go">跳轉(zhuǎn)</a> ????</div> </body> </html>
查看完整描述

2 回答

已采納
?
haodaking

TA貢獻(xiàn)1條經(jīng)驗(yàn) 獲得超0個(gè)贊

http://img1.sycdn.imooc.com//55e9459d0001d51907040320.jpg

代碼:64行,76行,多倆大括號(hào)。建議打開(kāi)web開(kāi)發(fā)工具逐行調(diào)試

查看完整回答
反對(duì) 回復(fù) 2015-09-04
  • KokoTa
    KokoTa
    用開(kāi)發(fā)工具的時(shí)候跳出來(lái)這個(gè)Uncaught SyntaxError: Unexpected token : 不是提示大括號(hào),所以不知道要如何調(diào)試,非常感謝!
?
twocold

TA貢獻(xiàn)20條經(jīng)驗(yàn) 獲得超14個(gè)贊

event,cancelBubble?=?true; ? 73行,逗號(hào)

查看完整回答
反對(duì) 回復(fù) 2015-09-02
  • KokoTa
    KokoTa
    已修改,66行提示Uncaught SyntaxError: Unexpected token : 不知道是怎么回事?
  • 2 回答
  • 0 關(guān)注
  • 2109 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)