2013-04-01 69 views
0

我剛開始爲BB10寫一個應用程序,並玩弄calendarEvent對象。blackberry.pim.calendar不適合我

function createEvents(location, summary, startTime, endTime, frequency, dayInWeek, expires) { 

var testing = blackberry.pim.calendar; 
document.write("<p>My First app</p>"); 

var evt, 
calendar = blackberry.pim.calendar, 
CalendarRepeatRule = calendar.CalendarRepeatRule; 
var start = new Date(startTime); 
var end = new Date(endTime); 
var location = location; 
var summary = summary; 
. 
. 
. 
} 

我在波動運行此,但它甚至不會打印出「我的第一個應用程序」,當我運行該功能。 在我的config.xml中我有

被卡住了幾個小時,任何幫助將不勝感激!

回答

1

的blackberry.pim.calendar API不支持紋波: https://developer.blackberry.com/html5/apis/blackberry.pim.calendar.html

我懷疑,當你設置createEvents內的測試變量運行時錯誤發生。打開Web檢查員確認。

建議執行功能檢測以確保您即將使用的對象可用。

function createEvents(location, summary, startTime, endTime, frequency, dayInWeek, expires) { 

    if (window.blackberry && blackberry.pim) { 
     var testing = blackberry.pim.calendar; 
     document.write("<p>My First app</p>"); 

     var evt, 
     calendar = blackberry.pim.calendar, 
     CalendarRepeatRule = calendar.CalendarRepeatRule; 
     var start = new Date(startTime); 
     var end = new Date(endTime); 
     var location = location; 
     var summary = summary; 
    } else { 
     alert("blackberry.pim is not supported"); 
    } 
. 
. 
. 
} 
+0

是啊我認爲你是對的,那是愚蠢的我,我認爲波紋可以運行,因爲它讓我在bb10設置平臺。謝謝 – user308553