function Human(name,currentMail,currentScore,newScore){
this.name=name || document.querySelectorAll('#e1').value || "Enter Name";
this.currentMail= currentMail || document.querySelectorAll('#e2').value ||
"Enter Email";
this.currentScore=currentScore || document.querySelectorAll('#e3').value ||
"Enter Score";
this.changeScore = function(ns){
if (ns!=""){
console.log(ns+" Is Your New Score");
this.currentScore=ns;}
};
this.changeMail = function(cmail){
if(cmail!=""){
console.log(cmail + " Is Your New Mail");
this.currentMail = cmail};
};
this.Xport = function(){
var exporte=
window.open("", "MsgWindow", "width=200, height=100");
exporte.document.writeln("<p>"+ this.name +
" "+this.currentMail+
" " + this.currentScore "</p>");
};
};
var ilan = new Human();
ilan.name= "ilan Vachtel";
ilan.currentMail = "[email protected]";
ilan.currentScore = "95";
ilan.newScore = "89";
ilan.changeScore("89");
console.log(ilan.currentScore);
ilan.changeMail("[email protected]");
console.log(ilan.currentMail);
var haim = new Human();
haim.name = "Haimon";
haim.currentMail="[email protected]";
haim.currentScore="54";
console.log(haim);
haim.changeScore("77");
haim.changeMail("[email protected]");
haim.Xport();
這是一個JavaScript Obect Orientd文件試圖從一個窗口中的另一個出口一些東西 之後收集他們從輸入值在窗體或手動輸入,我總是得到「Syntac錯誤的的Xport功能,它不是有效的,我在做什麼錯爲什麼它不讓我使用窗口打開,我在做什麼錯?
當然語法錯誤給你的行號?並在開發工具中的鏈接?並告訴你,意想不到的標記是'this'?任何合理的瀏覽器。 – 2014-09-20 11:39:06
它告訴我,當我嘗試調用該函數的位置時,該行在結尾處(haim.Xport(); – Ilan 2014-09-20 12:36:14