我想在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庫嗎?