WScript未定义 [英] WScript is undefined

查看:670
本文介绍了WScript未定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在本地运行一个Javascript文件,它应该使用ImageMagick创建一个CSS图像精灵。它是OpenID选择器JS组件的一部分: http://code.google.com/p/openid -selector /

I am trying to run a Javascript file locally, which is supposed to create a CSS image sprite using ImageMagick. It's part of the OpenID selector JS component: http://code.google.com/p/openid-selector/

generate-sprite.js(http://code.google.com/p/openid-selector/source/browse/trunk /generate-sprite.js?r=140)文件应该自动创建图像精灵。但是,无论何时我在IE中运行它(当然是文件的本地版本),我都会收到错误SCRIPT5009:在第19行,字符1中未定义'WScript'。

The generate-sprite.js (http://code.google.com/p/openid-selector/source/browse/trunk/generate-sprite.js?r=140) file is supposed to create the image sprite automatically. However, whenever I run it in IE (the local version of the file, of course), I get the error SCRIPT5009: 'WScript' is undefined on line 19, character 1.

我当然安装了ImageMagick并更新了js文件中的位置。 IE9让ActiveX执行。

I have of course installed ImageMagick and updated the location in the js file. IE9 is letting the ActiveX execute.

由于我不熟悉WScript,我完全迷失了。谷歌搜索并没有帮助,因为这似乎是一个非常普遍的错误。

Since I'm not familiar with WScript, I am completely lost. Googling didn't help, since this seems to be a very generic error.

有人可以帮助诊断这个错误吗?

Can somebody help diagnose this error please?

推荐答案

当你说你在本地运行JavaScript文件时,你使用的是Windows吗?如果是这样,并且双击或从命令行键入文件名不起作用,请尝试:

When you say you're "running" the JavaScript file locally, are you using Windows? If so, and double-clicking or typing the filename from the command line doesn't work, try:

wscript generate-sprite.js

...显式调用 wscript.exe

如果您不使用Windows,则无法使用该脚本 —它依赖于Windows和Microsoft的JScript( wscript.exe 程序调用)。

If you're not using Windows, you can't use that script — it relies on both Windows and Microsoft's JScript (which the wscript.exe program invokes).

这篇关于WScript未定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆