简体   繁体   English

钛制加速器中的功能问题

[英]function issue in appcelerator titanium

In My app i am calling function like below but toJSDate function not invoked. 在我的应用程序中,我正在调用以下函数,但未调用toJSDate函数。 What is the problem can anyone tell why. 有什么问题可以告诉别人原因。

In console i get only getIssueProgress Called. 在控制台中,我只会调用getIssueProgress。

Below i am sharing code. 下面我共享代码。

function toJSDate(){
      Ti.API.info('getIssueProgress Called');
}
function getIssueProgress() {
    Ti.API.info('getIssueProgress Called');
    var check_Date = toJSDate('anil');
}

your toJSDate() doesn't expect a parameters but your calling it with a parameter var check_Date = toJSDate('anil'); 您的toJSDate()不需要参数,但是需要使用参数var check_Date = toJSDate('anil');调用它var check_Date = toJSDate('anil'); . Remove 'anil' : 删除'anil'

 function toJSDate(){ console.log('toJSDate'); //Ti.API.info('getIssueProgress Called'); } function getIssueProgress() { console.log('getIssueProgress'); //Ti.API.info('getIssueProgress Called'); var check_Date = toJSDate();//not: toJSDate('anil'); } getIssueProgress(); 

If you do want to pass that parameter you need to add it to the function declaration 如果确实要传递该参数,则需要将其添加到函数声明中

 //add parameter here function toJSDate(param){ console.log('toJSDate'); console.log(param); //Ti.API.info('getIssueProgress Called'); } function getIssueProgress() { console.log('getIssueProgress'); //Ti.API.info('getIssueProgress Called'); var check_Date = toJSDate('anil'); } getIssueProgress(); 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM