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百度网盘真实地址解析

Delphi tdirectory.tfilterpredicate

Delphi 让scrollbox响应鼠标滚轮事件

Delphi 验证tstrings是否存在

Delphi 获取毫秒级时间戳

Delphi 关闭xp保护 替换explorer.exe

Delphi 取到系统临时文件夹路径

Delphi 遍历文件单元文件

Delphi分享pos函数。(比fastpos还要快)

进程防杀Delphi版(dll部分)

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



打赏

取消

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

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

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

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

评论

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