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

為了賬號安全,請及時綁定郵箱和手機立即綁定

報錯:Uncaught TypeError: LightBox is not a constructor

大家?guī)臀铱纯创a,代碼跟視頻上的一樣啊,為什么不能alert 1出來。

報錯:Uncaught TypeError: LightBox is not a constructor ?


js:

;(function($) {

var LightBox = function() {

var self = this;

//創(chuàng)建遮罩和彈出框

this.popupMask = $("<div id='G-lightbox-mask'></div>")

this.popupWin = $("<div id='G-lightbox-popup'></div>")

//保存body

this.bodyNode = $(document.body);

//渲染剩余的DOM插入到body;

this.renderDOM();

};

LightBox.prototype = {

renderDOM: function() {

alert("1");

}

};

window["LightBox"] = LightBox;?

})(jQuery);


html頁面

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8" />

<title></title>

<script src="js/jquery-2.2.1.min.js"></script>

<script src="js/LightBox.js"></script>

</head>

<body> ?


<script>

$(function(){

var LightBox = new LightBox();

})

</script>

</body>

</html>


正在回答

2 回答

var LightBox = new LightBox(); 加粗的要小寫,別沖突,或用其他的名字??!

0 回復(fù) 有任何疑惑可以回復(fù)我~

LightBox 不是構(gòu)造函數(shù)

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

報錯:Uncaught TypeError: LightBox is not a constructor

我要回答 關(guān)注問題
微信客服

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

幫助反饋 APP下載

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

公眾號

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