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的with…do语句的用法

Delphi 中拖动无边框窗口的5种方法

winapi 字符及字符串函数(9): lstrcat - 合并字符串

Delphi 使format输出百分号 %

Delphi的unicode与gb2312转转换,汉字unicode转gb2312

Delphi 从内存中加载并启动一个exe

Delphi读取webbrowse中的图片显示在image中

Delphi程序不受windows日期格式的影响

Delphi实现的sunday字符串搜索算法

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



打赏

取消

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

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

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

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

评论

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