在第29行(pixelScan)它顯示我在dreamweaver中的錯誤我想知道什麼是錯的請幫助,我不知道錯誤是什麼,我是JavaScript的所以請幫助我:我的JavaScript有什麼問題?它不斷給我一個錯誤在Dreamweaver
<script type="text/javascript">
var processes = {
timerCallback: function() {
if (this.myVideo.paused || this.myVideo.ended) {
return;
}
this.videocontentPlayer.drawImage(this.myVideo, 0, 0, this.width, this.height);
this.pixelScan();
var self = this;
setTimeout(function() {
self.timerCallback();
}, 0);
},
doLoad: function() {
this.myVideo = document.getElementById("myVideo");
this.videoPlayer = document.getElementById("videoPlayer");
this.videocontentPlayer = this.videoPlayer.getContext("2d");
this.videoPlayer2 = document.getElementById("videoPlayer2");
this.videocontentPlayer2 = this.videoPlayer.getContext("2d");
var self = this;
this.myVideo.addEventListener("playing", function() {
self.width = self.myVideo.videoWidth;
self.height = self.myVideo.videoHeight;
self.timerCallback();
}, false);
}
pixelScan: function() {
var frame = this.videocontentPlayer.getImageData(0, 0, this.width, this.height);
for (var i = 0; i < frame.data.length; i++) {
var r = frame.data[i];
var g = frame.data[i+1];
var b = frame.data[i+2];
if (g > 120 && 2 > 50 && r < 165 && b < 60)
frame.data[i + 3] = 0;
}
this.videocontentPlayer2.putImageData(frame, 0, 0);
return;
}
}
</script>
認真!你不會告訴我們在哪行代碼中發生了什麼錯誤?這就像是通過電話告訴機修工:「我的車壞了 - 出了什麼問題」,並沒有給他更多的信息。查看錯誤控制檯,你的錯誤將會顯示給你。 – jfriend00
冷靜的傢伙我編輯它 – Tasperen
你的問題仍然不好,因爲你沒有解釋你得到的錯誤。 –