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 2007 使用shelltreeview控件

Delphi dll注入x86/x64/win2k~win8.1全可用

Delphi firemonkey 学习笔记 �c tpopup 控件的使用

Delphi研究之驱动开发篇(六)--利用section与用户模式程

vclzip 3.10.1的简单使用示例

Delphi编写聊天程序

Delphi http post json示例

Delphi 在tedit中显示水印提示

Delphi xe8 无法进入android的调试状态

Delphi xe 使用savestate保存firemonkey状态的示例

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



打赏

取消

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

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

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

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

评论

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