\\\<br/>不工作在谷歌应用程序脚本Browser.msgBox [英] \n not working in google apps script Browser.msgBox

查看:84
本文介绍了\\\<br/>不工作在谷歌应用程序脚本Browser.msgBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


$ b

  function showMsgBox()

{
var msg ='name:\\\
\\\
\\\
Doc URL';
Browser.msgBox(Selected Doc template:,msg,Browser.Buttons.OK);
}

我无所谓单引号或双引号。



我也尝试过 Browser.msgBox(msg); 但它们都是一样的。



我做错了什么?



谢谢。

解决方案

由于历史原因,您需要双重转义\\\


  function myFunction(){
Browser .msgBox(Hello \\\\World)
}


I am trying the following to add line breaks to a message box but it is not working.

function showMsgBox(){
  var msg = 'name: \n \n \n Doc URL';
  Browser.msgBox("Selected Doc template:", msg, Browser.Buttons.OK);
}

I does not matter single or double quotes.

I also tried Browser.msgBox(msg); but it is all the same.

What am I doing wrong?

Thank you.

解决方案

You need to double-escape "\n" for historical reasons

function myFunction() {
  Browser.msgBox("Hello\\nWorld")
}

这篇关于\\\<br/>不工作在谷歌应用程序脚本Browser.msgBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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