鉴于此URL:
https://script.google.com/macros/s/MacroName/dev?theArg="69.28.15.332"
Run Code Online (Sandbox Code Playgroud)
最重要的部分是:
?theArg="69.28.15.332"
Run Code Online (Sandbox Code Playgroud)
我正在尝试将信息传递到URL中的Apps脚本.为什么我的.gsGoogle Apps脚本函数不能获取URL末尾的字符串值?这是doGet(e)功能.
function doGet(e){
var passedInIP = e.parameter.theArg;
Logger.log(passedInIP);
if (passedInIP === "69.28.15.332")
{
return HtmlService.createHtmlOutput("<h2>something</h2>")
}
};
Run Code Online (Sandbox Code Playgroud)
我在浏览器中输出了这个错误信息:
脚本已完成但未返回任何内容
在Logger.log不登录的东西.它记录[Date Time EDT] "69.28.15.332"并且日志中的值与我正在检查的值完全相同.但是平等测试失败了.
Facebook提供了一些有关oauth登录参数的文档.
参数是:
是否有关于不同类型的oauth功能及其附带参数的更多信息?
我想了解如何构建URL的信息oauth.我知道几种配置.例如:
https://www.facebook.com/dialog/oauth?
client_id=YourAppID
&redirect_uri=The URL that you designated in your App Settings for your App
&response_type=token //Whether you want a `code` returned, or a `token` returned, or both
&scope=publish_stream // scope prompts the user for the type of permissions being asked for
Run Code Online (Sandbox Code Playgroud)
我看到一个讨论显示:
https://graph.facebook.com/oauth/authorize?
client_id=123456789
&redirect_uri=http://example.com/
&scope=publish_stream,share_item,offline_access,manage_pages
Run Code Online (Sandbox Code Playgroud)
请注意URL的差异:
/dialog/oauth?
Run Code Online (Sandbox Code Playgroud)
要么
/oauth/authorize?
Run Code Online (Sandbox Code Playgroud)
怎么authorize办?是否授予权限而不是为权限请求权限?这方面的文件在哪里?
我有一个Google Sheet,它运行一些Apps Script服务器代码以连接到SQL服务器.我想在刷新数据时在模式对话框中显示消息"loading ...".我可以弹出模态,但是我想在代码完成后立即自动关闭对话框.
我设置的一个例子是:
function testpop () {
var htmlOutput = HtmlService
.createHtmlOutput('<p> This box will close when the data has finished loading.</p>')
.setSandboxMode(HtmlService.SandboxMode.IFRAME)
.setWidth(250)
.setHeight(200);
SpreadsheetApp.getUi().showModalDialog(htmlOutput, 'Loading...');
sleep(1000);
//close the dialog
}
Run Code Online (Sandbox Code Playgroud)
我知道这可以在客户端调用,但是需要在GS中处理它,以便在代码完成时触发它.
我想将图像数据从Facebook应用程序发布到Facebook页面.
我尝试使用stream.publish.我能够发布图片但不推荐使用.而且我也无法发布链接.
使用stream.publish发布的curl请求如下: -
curl -F'access_token = dsdsdsd'\ -F'message ='\ -F'uid = 23434'\ -F' attachment = {"media":[{"type":"image","src":"http ://url.com/videothumb/465_06122010_p_bizpiyushgargeng_48271_10754.jpg"}],"名称":"{市场可能缩减:ICICI Sec","描述":"ICICI证券首席信息官Piyush Garg表示有可能缩减规模在市场上,因为大多数国内负面消息已经......","标题":"新闻"}'\ https://api.facebook.com/method/stream.publish
使用图谱API时,我无法从我的APP发布.
而是通过我的个人资料发布.
任何帮助是极大的赞赏.
http://php-academy.blogspot.com/2011/04/how-to-post-from-facebook-app-to.html
当我在电子表格中更改某些内容时,onEdit()触发器会运行,我可以看到我放入代码中的所有msgbox.
我的功能在此行停止
MailApp.sendEmail(emailAddress, subject, message);
Run Code Online (Sandbox Code Playgroud)
我从未看到"电子邮件已发送!"消息,并在执行转录中出错:
您无权调用sendEmail
如果我直接在脚本编辑器中运行脚本,一切正常......
这是我的代码:
function onEdit() {
var sheet = SpreadsheetApp.getActiveSheet();
var sheetname = sheet.getName()
var AcCellRange = sheet.getActiveCell()
var AcCol = AcCellRange.getColumn()
var AcRow = AcCellRange.getRow()
if (sheetname=="Questions/Réponses") {
//Browser.msgBox(AcCol+' / '+AcRow)
//liste d'instructions
//Boucle si les colonne sont comprise dans le range
if ((AcCol==3) || ((AcCol==7))){
//Browser.msgBox(AcCol)
if (AcRow > 7){
//Browser.msgBox(AcRow)
sendEmails()
}
}
}
else
{}
}
function sendEmails() {
Browser.msgBox('SendEmails')
var spreadsheet = SpreadsheetApp.getActive();
var sheet = spreadsheet.getSheetByName('ListCourriel'); …Run Code Online (Sandbox Code Playgroud) 当使用Utilities.parseCsv()双引号内的换行符时,假定完全是新行。该函数的输出数组将有几个不正确的行。
我该如何解决这个问题,或者解决这个问题?
编辑:具体来说,我可以转义仅存在于双引号内的换行符吗?IE。
/r/n "I have some stuff to do:/r/n Go home/r/n Take a Nap"/r/n
Run Code Online (Sandbox Code Playgroud)
会被转义为:
/r/n "I have some stuff to do://r//n Go home//r//n Take a Nap"/r/n
Run Code Online (Sandbox Code Playgroud)
Edit2:2012年的错误报告:https://code.google.com/p/google-apps-script-issues/issues/detail? id=1871
我使用的是GAS网络应用,当用户执行某些操作(例如点击特定的div)时,该应用需要刷新其内容。
在客户端,我有一个从onclick调用的脚本
google.script.run.withSuccessHandler(refreshCallback).myServersideFunction();
function refreshCallback(roomsPlus) {
var statusDiv = document.getElementById("status");
statusDiv.innerHTML = "Reloading...";
window.location.reload(true);
};
Run Code Online (Sandbox Code Playgroud)
状态div更改为“正在重新加载...”,因此我知道回调已被调用,但随后它从未重新加载页面。Caja或google apps脚本会禁用页面刷新吗?还有另一种刷新页面的方法吗?
我想div手动创建一个元素,然后使用JavaScript为它添加一些CSS样式.我创建了一个div元素并用JavaScript改变了它的风格.问题是,一些CSS样式不起作用.
(color,background,width,height)这些属性的工作不错,但(zIndex,top,left)性能不工作.我想知道为什么会发生这种情况以及如何纠正它.
这是我的JavaScript代码:
function css()
{
var element = document.createElement('div');
element.id = "someID";
document.body.appendChild(element);
element.appendChild(document.createTextNode
('hello this javascript works'));
// these properties work
document.getElementById('someID').style.zIndex='3';
document.getElementById('someID').style.color='rgb(255,255,0)';
document.getElementById('someID').style.background='rgb(0,102,153)';
document.getElementById('someID').style.width='700px';
document.getElementById('someID').style.height='200px';
//these do not work
document.getElementById('someID').style.left='500px';
document.getElementById('someID').style.top='90px';
}
Run Code Online (Sandbox Code Playgroud)
这是我的相关HTML代码
<input type="submit" name="cssandcreate" id="cssandcreate" value="css" onclick="css();"/>
Run Code Online (Sandbox Code Playgroud) 我目前正在使用这个脚本:
function onEdit(e)
// Set a comment on the edited cell to indicate when it was changed.
var range = e.range;
range.setNote('Laatst veranderd: ' + new Date());
Run Code Online (Sandbox Code Playgroud)
我需要添加什么才能只在“C”列中起作用?
JavaScript 日期方法之间有什么区别:
setUTCminutes()
Run Code Online (Sandbox Code Playgroud)
相对
setMinutes()
Run Code Online (Sandbox Code Playgroud)
使用是否会将setMinutes()时区恢复为 UTC 以外的时区?
我正在考虑是否使用日期字符串设置 UTC 时间:
var dUTC = new Date('March 20, 2016 20:45:00 UTC');
Run Code Online (Sandbox Code Playgroud)
或使用 UTC 方法设置日期,然后设置小时等:
var d = new Date(2016,3,20);
d.setUTCHours(20);
d.setUTCminutes(45);
Run Code Online (Sandbox Code Playgroud)
但是,我担心第二种方法在某些情况下可能不准确。我不想最终得到错误的 UTC 日期。我的附加组件可以在世界各地使用。