![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js小问题
NoCarrots
这个作者很懒,什么都没留下…
展开
-
字符串转义(函数传递字符串时)
用字符串表示标签时,其函数参数为字符串对象需要用到字符串转义符,否则无法使用。(1)在单引号内'<a onclick="details(\''+p.name+'\')">'+p.name+'</a>';(2)在双引号内"<a onclick='details(\""+p.name+"\")'>"+p.name+"&a原创 2018-08-08 17:05:35 · 1226 阅读 · 0 评论 -
JS String类型与Date类型互转
1.String转Datevar str="20180302";var time= new Date(str);2.Date转Stringvar nowTime = now.getFullYear() + ((now.getMonth() + 1) < 10 ? "0" : "") + (now.getMonth() + 1) + (now.getDate() < 1...原创 2019-03-27 16:32:02 · 4151 阅读 · 0 评论