【发布时间】:2014-07-29 12:11:05
【问题描述】:
使用 google 脚本,我编写了一个简单的 Web 应用程序,该应用程序返回用户电子邮件,部署它并且工作正常 - 返回活动用户的电子邮件。 问题是我要在 html 页面上显示该用户的电子邮件,例如:
脚本:
$(document).ready(function(){
$('#userID').load('---web app url---');
});
HTML:
<p>Active user:</p>
<div id="userID"></div>
我得到错误 meggase:
XMLHttpRequest cannot load /web app url here/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.
据我了解,问题在于启用 CORS,但我找不到解决方案。 如何将该谷歌网络应用加载到我的 html 页面?
我没有服务器,它是一个简单的 html 页面,我相信这个问题必须有一个简单的解决方案。
谢谢。
【问题讨论】:
标签: javascript jquery html google-app-engine