2012-08-08 79 views
0

我很新的科尔多瓦,所以请忍受我。我正在使用这里找到的插件:https://github.com/phonegap/phonegap-plugins/tree/master/iOS/CalendarPluginPhoneGap /科尔多瓦日历iOS插件不发送信息

并已在示例中实现它,但它只是不适合我。我得到的错误:

Uncaught SyntaxError: Unexpected token ( 

但不能看到这是从哪里来。

任何人都可以指向正确的方向吗?

$(function() { 

      $('.calinfo').live('click', function() { 
           var desiredValue = $(this).data('calinfo'); 

           var cal; 
           cal = window.plugins.calendarPlugin 

           // function call in Javascript: 

           //createEvent : 
           function(title,location,notes, startDate, endDate){ 
           var title= "My Appt"; 
           var location = "Los Felix"; 
           var notes = "me testing"; 
           var startDate = "2012-11-23 09:30:00"; 
           var endDate = "2012-11-23 12:30:00"; 

           cal.createEvent(title,location,notes,startDate,endDate); 
           }; 
      }); 
     }); 

回答

0

我消毒,你的代码了一下,试试行不行:

/*global $:true */ 
$(function() { 
    "use strict"; 

    $('.calinfo').live('click', function() { 
    var desiredValue = $(this).data('calinfo'); 
    var cal = window.plugins.calendarPlugin; 

    // function call in Javascript: 

    //createEvent : 
    (function createEvent(title, location, notes, startDate, endDate) { 
     title= "My Appt"; 
     location = "Los Felix"; 
     notes = "me testing"; 
     startDate = "2012-11-23 09:30:00"; 
     endDate = "2012-11-23 12:30:00"; 

     cal.createEvent(title,location,notes,startDate,endDate); 
    }()); 
    }); 
}); 
相关问题