admin管理员组文章数量:1420561
I'm looking for a way to load an external Javascript library to my Google Adwords Scripts IDE. I can't find anything on this in the docs or execute the JS through the URLFetchApp API (/). Have anyone tried this or have any ideas?
I know one can do this in for example JQuery, but from what I can see in the source code, the way they implement it is by adding a HTML script-tag and let the browser load it. Since I'm not in a browser in this environment, this will not be possible.. I guessing I'm in some V8-engine environment.
I'm looking for a way to load an external Javascript library to my Google Adwords Scripts IDE. I can't find anything on this in the docs or execute the JS through the URLFetchApp API (https://developers.google./apps-script/reference/url-fetch/). Have anyone tried this or have any ideas?
I know one can do this in for example JQuery, but from what I can see in the source code, the way they implement it is by adding a HTML script-tag and let the browser load it. Since I'm not in a browser in this environment, this will not be possible.. I guessing I'm in some V8-engine environment.
Share Improve this question asked Apr 8, 2013 at 10:58 Niklas9Niklas9 9,4068 gold badges42 silver badges61 bronze badges1 Answer
Reset to default 7I managed to get this working by:
function main() {
var url = "http://example./asdf.js";
eval(UrlFetchApp.fetch(url).getContentText());
}
eval isn't sandboxed away obviously! :)
本文标签: javascriptLoad external JS file in Google Adwords ScriptsStack Overflow
版权声明:本文标题:javascript - Load external JS file in Google Adwords Scripts - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745335563a2654021.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论