如何在JavaScript块中的HTML模板中禁用转义URL /字符串

I've tried to render a url as string, URL, JS and HTML. In all the cases this:

 <script>
  var someUrl = "{{ .myUrl }}";
 </script>

gets rendered to this value:

https:\/\/some_domain123.com\/path1\/path2\/path3

No matter what.

I want this:

https://some_domain123.com/path1/path2/path3

What actually works?

查看全部
duanpie2834
duanpie2834
2019/01/12 22:52
  • javascript
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复