我想在YQL表中使用外部JavaScript库,因为我想使用此库提供的MD5函数。这里是我尝试包括外部JavaScript我<execute>
块的部分:无法包含Javascript ReferenceError:“窗口”未定义
<execute><![CDATA[
// MD5 hashing from crypto-js
y.include("http://crypto-js.googlecode.com/files/2.3.0-crypto-md5.js");
var sig2 = Crypto.MD5("test string", {asString: true});
y.log(sig2);
]]></execute>
当我尝试使用此YQL表然后我收到以下错误信息:
Exception: Unable to include Javascript http://crypto-js.googlecode.com/files/2.3.0-crypto-md5.js , ReferenceError: "window" is not defined.
显然JavaScript的库正在扩展DOM的window
对象,并带有一个额外的Crypto对象。
现在我的问题是,我可以使用YQL这样的JavaScript库吗?