亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么alert 沒有彈出1????????????

為什么alert 沒有彈出1????????????

慕粉3430898 2016-12-25 15:22:56
<!DOCTYPE html><html><head>? ? <meta ?http-equiv="content-type" content="text/html" ?charset="UTF-8">? ? <title>lightBox</title>? ? <script type="text/javascript" src= "jQuery.js" > </script>? ? <script type="text/javascript" src= "demo.js" > </script>? ? <link rel="stylesheet" href="bas.css" type="text/css">? ? <link rel="stylesheet" href="box.css" type="text/css"></head><body><!--遮罩層--><div id="lightbox-max"></div><!--彈出層--><div id="lightbox-poput">? ? <div>? ? ? ? <span class="lightbox-btn lightbox-btn-show"></span>? ? ? ? <img src="2-2.jpg" width="100%">? ? ? ? <span class="light-next-btn lightbox-next-btn-show"></span>? ? </div>? ? <div>? ? ? ? <div>? ? ? ? ? ? <p>標題:非鐵</p>? ? ? ? <span>索引:0027</span>? ? ? ? </div>? ? ? ? <div></div>? ? </div></div><script>? ? $(function(){? ? ? ? var Light=new lightBox();? ? });</script></body></html;(function($){? ? alert(1);? ? var lightBox=function(){? ? ? ? alert(2);? ? };? ? lightBox.prototype={? ? };? ? window["lightBox"]=lightBox;})(jQuery);為什么alert ?沒有彈出1?。??????????
查看完整描述

4 回答

?
MarlboroKay

TA貢獻189條經驗 獲得超236個贊

你沒有調用啊,他怎么執行。
查看完整回答
3 反對 回復 2016-12-25
?
習慣受傷

TA貢獻885條經驗 獲得超1144個贊

后邊html標簽閉合不全
查看完整回答
1 反對 回復 2016-12-25
?
慕粉1103124771

TA貢獻16條經驗 獲得超1個贊


http://img1.sycdn.imooc.com//58608ff60001954903650274.jpghtml沒有關閉,你這個代碼應該會報錯的啊

查看完整回答
反對 回復 2016-12-26
?
慕俠4409898

TA貢獻2條經驗 獲得超0個贊

html沒有正確閉合,書寫的js代碼一定要放到script標簽中

查看完整回答
反對 回復 2016-12-26
?
隔壁老伍丶

TA貢獻15條經驗 獲得超6個贊

<!DOCTYPE?html>
<html>
<head>
????<meta??http-equiv="content-type"?content="text/html"??charset="UTF-8">
????<title>lightBox</title>

????<script?type="text/javascript"?src=?"jQuery.js"?>?</script>
????<script?type="text/javascript"?src=?"demo.js"?>?</script>


????<link?rel="stylesheet"?href="bas.css"?type="text/css">
????<link?rel="stylesheet"?href="box.css"?type="text/css">


</head>
<body>
<!--遮罩層-->
<div?id="lightbox-max"></div>
<!--彈出層-->
<div?id="lightbox-poput">
????<div>
????????<span?class="lightbox-btn?lightbox-btn-show"></span>
????????<img?src="2-2.jpg"?width="100%">
????????<span?class="light-next-btn?lightbox-next-btn-show"></span>
????</div>
????<div>
????????<div>
????????????<p>標題:非鐵</p>
????????<span>索引:0027</span>
????????</div>
????????<div></div>
????</div>
</div>

<script>
????$(function(){
????????var?Light=new?lightBox();
????});
????
????;(function($){
????????alert(1);
????????var?lightBox=function(){
????????????alert(2);
????????};
????????lightBox.prototype={
????
????????};
????????window["lightBox"]=lightBox;
????})(jQuery);
</script>
</body>
</html>


查看完整回答
反對 回復 2016-12-25
?
慕數據5775487

TA貢獻76條經驗 獲得超19個贊

不知道你把代碼放在script標簽外是什么意思,它怎么能執行,http://img1.sycdn.imooc.com//585f7cc60001a7c402140148.jpg

查看完整回答
反對 回復 2016-12-25
?
這雞湯有毒

TA貢獻1條經驗 獲得超0個贊

</html 后面少一個> 可能是的
查看完整回答
反對 回復 2016-12-25
  • 4 回答
  • 0 關注
  • 2223 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號