在JS上下文中,普通字符串总是被转义。我应该
template.JS在打印之前将其转换为类型。
参考:http :
//golang.org/pkg/html/template/#JS
这是新的元帅功能:
"marshal": func(v interface {}) template.JS { a, _ := json.Marshal(v) return template.JS(a)},
在JS上下文中,普通字符串总是被转义。我应该
template.JS在打印之前将其转换为类型。
参考:http :
//golang.org/pkg/html/template/#JS
这是新的元帅功能:
"marshal": func(v interface {}) template.JS { a, _ := json.Marshal(v) return template.JS(a)},