从谷歌小号preadsheet自定义功能做出Ajax调用 [英] Ajax calls made from Google Spreadsheet Custom Function

查看:167
本文介绍了从谷歌小号preadsheet自定义功能做出Ajax调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,伙计们有你们当中有谁曾经试图写一个脚本内的谷歌小号preadsheet进行调用Ajax网站。我希望让这个在S preadsheet更新自己的网站。但只是把的code此短块后,我抛出了一个错误:的ReferenceError:没有定义XMLHtt prequest任何帮助球员?我必须调用某个库?

  XMLHTTP =新XMLHtt prequest();
xmlhttp.open(GET,的EventObject [1],真);
xmlhttp.send();
 

解决方案

谷歌Apps脚本不支持 XMLHtt prequest()本身,但你怀疑这是可以完成同样的事的服务。

UrlFetch服务,的类XML (德precated)和的 XML服务

其中一个应用程序的脚本教程(通过Google Apps脚本 访问Picasa网络相册)涵盖了使用这些服务,而将是一个很好的地方为你展开。

Hey guys have anyone of you ever tried to write a script inside a Google Spreadsheet to make an ajax call to a website. I want to make it so that the spreadsheet updates itself from the website. But after just putting this short block of code, I get thrown an error: "ReferenceError: "XMLHttpRequest" is not defined." Any help guys? Do I have to call a certain library?

xmlhttp=new XMLHttpRequest();
xmlhttp.open("GET", eventObject[1], true);
xmlhttp.send();

Google Apps Script does not support XMLHttpRequest() natively, but as you suspected there are services that can accomplish the same thing.

Look at UrlFetch Services, Class Xml (deprecated) and Xml Services.

One of the apps script tutorials (Accessing Picasa Web Albums through Apps Script) covers the use of these services, and would be a good place for you to start.

这篇关于从谷歌小号preadsheet自定义功能做出Ajax调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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