Run JavaScript in Windows

前端 未结 5 895
一个人的身影
一个人的身影 2021-02-14 06:21

I thought for some simple tests that just run a few commands i would try using some JavaScript and run it from the command line in Windows XP.

So for a quick test I crea

5条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-14 06:56

    Try a named function replace since WSH does not support the window.alert method.

    if (!alert) alert = function foo(s){WScript.Echo(s)}
    alert("hello world");
    

提交回复
热议问题