首页 > 技术文章 > typescript里面调用javasript

maomingchao 2017-08-24 09:48 原文

 

index.html 里面加入函数:

function tellYou() {
egret.log("tell you.");
javascript:android.funA();
}

对应的ts文件:

declare function tellYou();

private onSocketOpen():void{
this.connectTimes = 0;
egret.log("connect success.");
tellYou();
}

 

推荐阅读