2013-04-17 68 views
0

I'm making a simple Web apps using Google Apps Script. When I wrote as<a href = "tel: becomes malform in GAS html service

< a href = "tel: telphone no" > telphone no</a > 

in template file, the error occurs as below.

Invalid script or HTML content: HtmlOutput:4+11 - 28: malformed url tel: telphone no 

and when I embedded javascript to make html < a href = "tel: ... ,

tag 'tel:' deleted automatically.

How can I make < a href = "tel: tag using GAS?

+0

请编辑您的问题。你需要更清楚你做了什么,以及你在问什么。如果你有代码示例,请包含它们。 – Mogsdad

+0

我编辑了我的问题,因为某些“<” – user1500263

+0

我的问题的某些部分不可见,所以您试图将点击拨号链接放入页面。你能展示更多的代码吗?在你的小例子中,(A)没有数字,这是一个问题,(B)有空格,这是无效的。 – Mogsdad

回答

0

There are a number of characters that are not allowed in URLs, such as that space between "telephone" and "no".

To avoid such problems when generating a URL in code, make use of encodeURIComponent(). See this reference