您好,欢迎访问一九零五行业门户网

JavaScript实现存储HTML字符串示例_javascript技巧

我是搞php的,让我想起了
复制代码 代码如下:
function.prototype.heredoc = function(){
// 利用 function 的注释来存储字符串,而且无需转义。
var _str = this.tostring(),
s_pos = _str.indexof(/*)+2,
e_pos = _str.lastindexof(*/);
return (s_pos}
function fn(){
/*
用户名
密码
@name
zf123456
*/
}
var str_table = fn.heredoc();
console.log(str_table);
其它类似信息

推荐信息