2013-04-17 63 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