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根据url获取缓存文件的方法

Delphi 判断iso文件,iso文件头, iso filehead

Delphi xe6 string转memorystream

Delphi firedac压缩和修复ms access数据库

Delphi ioutils 单元(5): tdirectory.tdirectory 的其他功能

Delphi 如何判断某一窗口最大化

Delphi pi 精确计算返回圆周率

Delphi getmodulefilename函数的用法(可以获取项目的路径,桌面的路径,我的文档的路径)

Delphi 立即停止timer

Delphi 通过api 隐藏任务栏时间日期

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



打赏

取消

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

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

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

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

评论

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