delphi 调用javascript

function ExecScript(Code,Lang,Func:string):string; 
var 
  script:OleVariant; 
begin 
  try 
    script:=CreateOleObject('ScriptControl'); 
    script.Language:=Lang; 
    script.AddCode(Code); 
    Result:=script.Eval(Func); 
  except 
  end; 
end; 

posted on 2011-11-18 18:43  外星E号  阅读(141)  评论(0编辑  收藏  举报

导航