delphi TMS WEB core 从JS调用pascal函数


本文整理自网络,侵删。

 
// this is a Pascal method
procedure MyPascalProc(s: string);
begin
  ShowMessage(s);
end;

procedure TForm1.WebButton1Click(Sender: TObject);
begin
  asm
    // this is pure Javascript code
    $impl.MyPascalProc("test");
  end;
end;



procedure TForm.MyTest;
var
  a: integer;
begin
   a := 42;
   asm
      alert('this is my JavaScript call ' +a);
   end;
end;

相关阅读 >>

Delphi xe5 android 程序退出功能

Delphi 收藏字符串处理单元

Delphi xe6调用android标准功能

Delphi中如何实现模糊查找文件

Delphi idhttp下载html的代码(含错误处理)

Delphi listview1 中添加check选中事件

Delphi 遍历控件

Delphi中的instrrev函数(倒找文本)

Delphi实现解析百度搜索结果link?url=

Delphi中启用禁止cd驱动器自动运行播放

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...