2015-01-03 62 views
0

我已經將一些js編碼爲用於研討會的Articulate Storyline文件。我試圖讓系統編譯一些變量並將數據發送給用戶。當我點擊圖標生成電子郵件時,我什麼都沒有收到。JavaScript未生成電子郵件

SET日期代碼

var d = new Date(); 
var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); 
var monthName = new Array("January","February","March","April","May","June","July","August","Septemeber","October","November","December"); 
var dateVal = d.getDate().toString(); 
var delimeter = ", "; 
var delimeter1 = " "; 
var txtPostdate = "" 
var lDigit = dateVal.charAt(dateVal.length-1); 
if (lDigit = = "1"){ 
    txtPostdate = "st"; 
}else if(lDigit = = "2"){ 
    txtPostdate = "nd"; 
}else if(lDigit = = "3"){ 
    txtPostdate = "rd"; 
}else{ 
    txtPostdate = "th"; 
} 
var dateString = weekday[d.getDay()]+delimeter+monthName[(d.getMonth())]+delimeter1+dateVal+txtPostdate+delimeter+d.getFullYear(); 
var player = GetPlayer(); 
player.SetVar("SystemDate",dateString); 

發送電子郵件CODE

var player = GetPlayer(); 

var useremail = player.GetVar("email"); 

var subject ="My Fact Sheet - Optimizing Your Online Job Applications"; 

var firstname = player.GetVar("firstname"); 
var lastname = player.GetVar("lastname"); 
var street = player.GetVar("street1"); 
var address2 = player.GetVar("street2"); 
var city = player.GetVar("city"); 
var state = player.GetVar("state"); 
var zip = player.GetVar("zip"); 
var phone = player.GetVar("phone"); 
var cell = player.GetVar("cell"); 
var mymail = player.GetVar("mymail"); 
var phone = player.GetVar("phone"); 
var cell = player.GetVar("cell"); 
var school1 = player.GetVar("school1"); 
var s1city = player.GetVar("s1city"); 
var s1degree = player.GetVar("s1degree"); 
var s1date = player.GetVar("s1date"); 
var s1start = player.GetVar("s1start"); 
var school2 = player.GetVar("school2"); 
var s2city = player.GetVar("s2city"); 
var s2degree = player.GetVar("s2degree"); 
var s2start = player.GetVar("s2start"); 
var s2date = player.GetVar("s2date"); 
var school3 = player.GetVar("school3"); 
var s3city = player.GetVar("s3city"); 
var s3degree = player.GetVar("s3degree"); 
var s3date = player.GetVar("s3date"); 
var s3start = player.GetVar("s3start"); 
var e1title = player.GetVar("e1title"); 
var e1start = player.GetVar("e1start"); 
var e1end = player.GetVar("e1end"); 
var e1 = player.GetVar("e1"); 
var e1employer = player.GetVar("e1employer"); 
var e1city = player.GetVar("e1city"); 
var e1state = player.GetVar("e1state"); 
var e1zip = player.GetVar("e1zip"); 
var e1super = player.GetVar("e1super"); 
var e1phone = player.GetVar("e1phone"); 
var e1reason = player.GetVar("e1reason"); 
var e1startsalary = player.GetVar("e1startsalary"); 
var e1endsalary = player.GetVar("e1endsalary"); 
var e1accomplish = player.GetVar("e1accomplish"); 
var e2title = player.GetVar("e2title"); 
var e2start = player.GetVar("e2start"); 
var e2end = player.GetVar("e2end"); 
var e2 = player.GetVar("e2"); 
var e2employer = player.GetVar("e2employer"); 
var e2city = player.GetVar("e2city"); 
var e2state = player.GetVar("e2state"); 
var e2zip = player.GetVar("e2zip"); 
var e2super = player.GetVar("e2super"); 
var e2phone = player.GetVar("e2phone"); 
var e2reason = player.GetVar("e2reason"); 
var e2startsalary = player.GetVar("e2startsalary"); 
var e2endsalary = player.GetVar("e2endsalary"); 
var e2accomplish = player.GetVar("e2accomplish"); 
var e3title = player.GetVar("e3title"); 
var e3start = player.GetVar("e3start"); 
var e3end = player.GetVar("e3end"); 
var e3 = player.GetVar("e3"); 
var e3employer = player.GetVar("e3employer"); 
var e3city = player.GetVar("e3city"); 
var e3state = player.GetVar("e3state"); 
var e3zip = player.GetVar("e3zip"); 
var e3super = player.GetVar("e3super"); 
var e3phone = player.GetVar("e3phone"); 
var e3reason = player.GetVar("e3reason"); 
var e3startsalary = player.GetVar("e3startsalary"); 
var e3endsalary = player.GetVar("e3endsalary"); 
var e3accomplish = player.GetVar("e3accomplish"); 
var r1name = player.GetVar("r1name"); 
var r1company = player.GetVar("r1company"); 
var r1email = player.GetVar("r1email"); 
var r1phone = player.GetVar("r1phone"); 
var r2name = player.GetVar("r2name"); 
var r2company = player.GetVar("r2company"); 
var r2email = player.GetVar("r2email"); 
var r2phone = player.GetVar("r2phone"); 
var r3name = player.GetVar("r3name"); 
var r3company = player.GetVar("r3company"); 
var r3email = player.GetVar("r3email"); 
var r3phone = player.GetVar("r3phone"); 
var cover = player.GetVar("cover"); 
var resume = player.GetVar("resume"); 
var mail = player.GetVar("mail"); 

var mailto_link='mailto:'+useremail+'?subject='+subject+'&body='+"Activity Notes – Optimizing Your Online Job Applications %0d%0A %0d%0AMy Name:%0d%0A」+firstname+」%0d%0A」+lastname+」%0d%0A%0d%0AMy Address:%0d%0A」+street1+」%0d%0A」+street2+」%0d%0A」+city+」%0d%0A」+state+」%0d%0A」+zip+」%0d%0A%0d%0AMy Home Phone: %0d%0A"+phone+」%0d%0A%0d%0AMy Cell Phone: %0d%0A」+cell+」%0d%0A%0d%0AMy eMail: %0d%0A "+mymail+」%0d%0A%0d%0AMy Education:%0d%0A」+school1+」%0d%0A」+s1city+」+s1degree+」%0d%0A」+s1start+」%0d%0A」+s1date+」%0d%0A%0d%0A」+school2+」%0d%0A」+s2city+」%0d%0A」+s2degree+」%0d%0A「+s1start+」%0d%0A」+s2date+」%0d%0A%0d%0A」+school3+」%0d%0A「+s3city+」%0d%0A「+s3degree+」%0d%0A「+s1start+」%0d%0A「+s3date+」%0d%0A%0d%0AMy Employment History - Job 1: %0d%0A「+e1title+」%0d%0A%0d%0ADates: %0d%0A 「+e1start+」%0d%0A「+e1end+」%0d%0A%0d%0AEmployer Information:%0d%0A「+e1+」%0d%0A「+e1employer+」%0d%0A「+e1city+」%0d%0A「+e1state+」%0d%0A「+e1zip+」%0d%0A%0d%0ACompany Contact: %0d%0A「+e1super+」%0d%0A「+e1phone+」%0d%0A%0d%0AReason for Leaving: %0d%0A「+e1reason+」%0d%0A%0d%0AStarting Salary: 「+e1startsalary+」%0d%0AEnding Salary: 」+e1endsalary+」%0d%0A%0d%0AAccomplishments:%0d%0A「+e1accomplish+」%0d%0A%0d%0AMy Employment History - Job 2:%0d%0A「+e2title+」%0d%0A%0d%0ADates:%0d%0A「+e2start+」%0d%0A「+e2end+」%0d%0A%0d%0AEmployer Information: %0d%0A「+e2+」%0d%0A「+e2employer+」%0d%0A「+e2city+」%0d%0A「+e2state+」%0d%0A「+e2zip+」%0d%0A%0d%0ACompany Contact: %0d%0A「+e2super+」%0d%0A「+e2phone+」%0d%0A%0d%0AReason for Leaving:%0d%0A「+e2reason+」%0d%0A%0d%0AStarting Salary: 「+e2startsalary+」%0d%0AEnding Salary: 「+e2endsalary+」%0d%0A%0d%0AAccomplishments:%0d%0A「+e2accomplish+」%0d%0A%0d%0AMy Employment History - Job 3:%0d%0A「+e3title+」%0d%0A%0d%0ADates:%0d%0A「+e3start+」%0d%0A「+e3end+」%0d%0A%0d%0AEmployer Information:%0d%0A 
「+e3+」%0d%0A「+e3employer+」%0d%0A「+e3city+」%0d%0A「+e3state+」%0d%0A「+e3zip+」%0d%0A%0d%0ACompany Contact:%0d%0A「+e3super+」%0d%0A「+e3phone+」%0d%0A%0d%0AReason for Leaving:%0d%0A「+e3reason+」%0d%0A%0d%0AStarting Salary: 「+e3startsalary+」%0d%0AEnding Salary: 「+e3endsalary+」%0d%0A%0d%0AAccomplishments:%0d%0A「+e3accomplish+」%0d%0A%0d%0AMy References:%0d%0A「+r1name+」%0d%0A「+r1company+」%0d%0A「+r1email+」%0d%0A「+r1phone+」%0d%0A%0d%0A「+r2name+」%0d%0A「+r2company+」%0d%0A「+r2email+」%0d%0A「+r2phone+」%0d%0A%0d%0A「+r3name+」%0d%0A「+r3company+」%0d%0A「+r3email+」%0d%0A「+r3phone+」%0d%0A%0d%0AMy Resume:%0d%0A「+resume+」%0d%0A%0d%0AMy Cover Letter:%0d%0A「+cover+」%0d%0A%0d%0A 

win=window.open(mailto_link,'emailWin'); 
+0

*「當我點擊圖標生成電子郵件時,我什麼都沒有收到。」* - 甚至沒有在瀏覽器的調試控制檯中出現錯誤?函數中的所有代碼都是? – nnnnnn

+0

我正在使用電子學習軟件程序,我只能在上傳到網絡後才能看到它,因爲java在預覽中不起作用。 –

+0

並感謝您的迴應! –

回答

0

嘗試把%20代替空格。提交的網址中的文字包含空格「活動筆記 - 優化您的在線.........」。我沒有調查整個網址,但一定要在需要的地方進行編碼。

+0

謝謝dmc ...我嘗試了你的建議,但仍然沒有,我不明白;我在另一個車間使用了類似的代碼,它f應該如此。 aaaargh! –

+0

您可能沒有在工作站上正確註冊電子郵件程序來處理mailto:。 – subjectivist

+0

我想我只需要把它掛起來過夜。大聲笑。我的眼球已準備好沉入我的頭骨。我嘗試了另一臺機器,仍然沒有。 –