jsの中でreplaceの正則は交替します.
64486 ワード
temp:
video":"\t<ul class=\"g-list tabview-cont on\">\t\r
\t\t<li class=\"g-pic cover\"><div class=\"slide-content\"><div class=\"slide-item first\"><a href=\"http://v.360.cn/news/index.html?src=hao360zc1&date=2014012603\"><img src=\"http://p8.qhimg.com/t019454e177d430322c.jpg\"><em class=\"txt icon-play\">< > </em><span class=\"txt-bg\"></span><span class=\"mask\"></span></a></div><div class=\"slide-item\"><a href=\"http://v.360.cn/news/index.html?src=hao360zc1&date=2014012602\"><img src=\"http://p9.qhimg.com/t015b48db5c407c3610.jpg\"><em class=\"txt icon-play\"> “ ” </em><span class=\"txt-bg\"></span><span class=\"mask\"></span></a></div><div class=\"slide-item\"><a href=\"http://v.360.cn/news/index.html?src=hao360zc1&date=2014012606\"><img src=\"http://p8.qhimg.com/t01fbcccc42240c8de2.jpg\"><em class=\"txt icon-play\"> </em><span class=\"txt-bg\"></span><span class=\"mask\"></span></a></div><div class=\"slide-item\"><a href=\"http://v.360.cn/news/index.html?src=hao360zc1\"><img src=\"http://p9.qhimg.com/t01af89d30596c83020.jpg\"><em class=\"txt icon-play\"> </em><span class=\"txt-bg\"></span><span class=\"mask\"></span></a></div></div><ul class=\"slide-nav\"><li class=\"selected\">0</li><li class=\"\">1</li><li class=\"\">2</li><li class=\"\">3</li></ul><a href=\"\" onclick=\"return false;\" class=\"slide-btn slide-pageup\" style=\"display: none;\"><span class=\"bg\"></span><em class=\"arrow\"><</em></a><a href=\"\" onclick=\"return false;\" class=\"slide-btn slide-pagedown\" style=\"display: none;\"><span class=\"bg\"></span><em class=\"arrow\">></em></a></li><li ><ins class=\"icon play\"></ins><a href=\"http://map.m.360.cn/t/ebwZ\" class=\" noactive \"> </a></li><li ><ins class=\"icon play\"></ins><a href=\"http://map.m.360.cn/t/ebvZ\" class=\" noactive \"> </a></li><li ><ins class=\"icon play\"></ins><a href=\"http://map.m.360.cn/t/emvZ\" class=\" noactive \"> </a></li><li ><ins class=\"icon play\"></ins><a href=\"http://v.360.cn/news/index.html?src=hao360zc1&date=2014012604\" class=\" noactive \"> </a></li>\t</ul>\t\r
\t<ul class=\"g-list tabview-cont\">\t\r
\t\t<li class=\"g-pic cover\"><div class=\"slide-content\"><div class=\"slide-item first\"><a href=\"http://v.360.cn/tv/PbZsaKOrSm0uNX.html?src=hao360zc2\"><img src=\"http://p8.qhimg.com/t01d1267f35383d4486.jpg\"><em class=\"txt icon-play\">《 》 </em><span class=\"txt-bg\"></span><span class=\"mask\"></span></a></div><div class=\"slide-item\"><a href=\"http://v.360.cn/tv/QbNqba3qRz8sOH.html?src=hao360zc2\"><img src=\"http://p9.qhimg.com/t0153603087c2ce9d83.jpg\"><em class=\"txt icon-play\">《 》 </em><span class=\"txt-bg\"></span><span class=\"mask\"></span></a></div><div class=\"slide-item\"><a href=\"http://v.360.cn/dianshi/hanju.html?src=hao360zc2\"><img src=\"http://p8.qhimg.com/t013d65140264b3b36a.jpg\"><em class=\"txt icon-play\">《 》 </em><span class=\"txt-bg\"></span><span class=\"mask\"></span></a></div><div class=\"slide-item\"><a href=\"http://v.360.cn/dianshi/index.html?src=hao360zc2\"><img src=\"http://p9.qhimg.com/t017ba1bc5290bf1dc5.jpg\"><em class=\"txt icon-play\"> </em><span class=\"txt-bg\"></span><span class=\"mask\"></span></a></div></div><ul class=\"slide-nav\"><li class=\"selected\">0</li><li class=\"\">1</li><li class=\"\">2</li><li class=\"\">3</li></ul><a href=\"\" onclick=\"return false;\" class=\"slide-btn slide-pageup\" style=\"display: none;\"><span class=\"bg\"></span><em class=\"arrow\"><</em></a><a href=\"\" onclick=\"return false;\" class=\"slide-btn slide-pagedown\" style=\"display: none;\"><span class=\"bg\"></span><em class=\"arrow\">></em></a></li><li ><ins class=\"icon play\"></ins><a href=\"http://v.360.cn/tv/PbJsb3KsRzXuOX.html?src=hao360zc2\" class=\" noactive \">《 》 </a></li><li ><ins class=\"icon play\"></ins><a href=\"http://v.360.cn/tv/PLZsbaGoSGXlM3.html?src=hao360zc2\" class=\" noactive \">《 》 </a></li><li ><ins class=\"icon play\"></ins><a href=\"http://v.360.cn/tv/Q4Vqaa7sRGTrMX.html?src=hao360zc2\" class=\" noactive \">《 2》 </a></li><li ><ins class=\"icon play\"></ins><a href=\"http://v.360.cn/tv/Q4lwaKKpSGDmNX.html?src=hao360zc2\" class=\" noactive \">《 》</a><a href=\"http://v.360.cn/tv/RbFpbKSrTzTqNH.html?src=hao360zc2\" class=\" noactive \">《 》</a></li>\t</ul>\t\r
\t<ul class=\"g-list tabview-cont\">\t\r
\t\t<li class=\"g-pic cover\"><div class=\"slide-content\"><div class=\"slide-item first\"><a href=\"http://v.360.cn/m/gqfiZUb8QXf3UR.html?src=hao360zc3\"><img src=\"http://p8.qhimg.com/t01b2037fbbf931e476.jpg\"><em class=\"txt icon-play\">《 》 </em><span class=\"txt-bg\"></span><span class=\"mask\"></span></a></div><div class=\"slide-item\"><a href=\"http://v.360.cn/m/gKPjZUXAQnL6TB.html?src=hao360zc3\"><img src=\"http://p9.qhimg.com/t0114c6fd1d4b464c20.jpg\"><em class=\"txt icon-play\">《 2》 </em><span class=\"txt-bg\"></span><span class=\"mask\"></span></a></div><div class=\"slide-item\"><a href=\"http://v.360.cn/m/hKfrZEnARXb3UR.html?src=hao360zc3\"><img src=\"http://p8.qhimg.com/t01384c78d1845872e2.jpg\"><em class=\"txt icon-play\">《 》 </em><span class=\"txt-bg\"></span><span class=\"mask\"></span></a></div><div class=\"slide-item\"><a href=\"http://v.360.cn/dianying/index.html?src=hao360zc3\"><img src=\"http://p9.qhimg.com/t017d8f8eebab0e2a21.jpg\"><em class=\"txt icon-play\"> </em><span class=\"txt-bg\"></span><span class=\"mask\"></span></a></div></div><ul class=\"slide-nav\"><li class=\"selected\">0</li><li class=\"\">1</li><li class=\"\">2</li><li class=\"\">3</li></ul><a href=\"\" onclick=\"return false;\" class=\"slide-btn slide-pageup\" style=\"display: none;\"><span class=\"bg\"></span><em class=\"arrow\"><</em></a><a href=\"\" onclick=\"return false;\" class=\"slide-btn slide-pagedown\" style=\"display: none;\"><span class=\"bg\"></span><em class=\"arrow\">></em></a></li><li ><ins class=\"icon play\"></ins><a href=\"http://v.360.cn/m/fqPnakD8SHX2UB.html?src=hao360zc3\" class=\" noactive \">《 》 </a></li><li ><ins class=\"icon play\"></ins><a href=\"http://v.360.cn/m/gKXnYkLAQXr5Sh.html?src=hao360zc3\" class=\" noactive \">《 》16 </a></li><li ><ins class=\"icon play\"></ins><a href=\"http://v.360.cn/m/gqTlZkPARnH3SR.html?src=hao360zc3\" class=\" noactive \">《 2 》 </a></li><li ><ins class=\"icon play\"></ins><a href=\"http://v.360.cn/m/gKjjZknAQXf0TB.html?src=hao360zc3\" class=\" noactive \">《 》</a><a href=\"http://v.360.cn/m/fajlZkH8RXL1UB.html?src=hao360zc3\" class=\" noactive \">《 》</a></li>\t</ul>\t\r
\t<ul class=\"g-list tabview-cont\">\t\r
\t\t<li class=\"g-pic cover\"><div class=\"slide-content\"><div class=\"slide-item first\"><a href=\"http://v.360.cn/yule/index.html?src=hao360zc4&date=201401262\"><img src=\"http://p8.qhimg.com/t017755193cd9f0a3de.jpg\"><em class=\"txt icon-play\">21 </em><span class=\"txt-bg\"></span><span class=\"mask\"></span></a></div><div class=\"slide-item\"><a href=\"http://v.360.cn/yule/index.html?src=hao360zc4&date=201401263\"><img src=\"http://p9.qhimg.com/t01d71367c6e2fc9e0e.jpg\"><em class=\"txt icon-play\">Makiyo 《 》 </em><span class=\"txt-bg\"></span><span class=\"mask\"></span></a></div><div class=\"slide-item\"><a href=\"http://v.360.cn/yule/index.html?src=hao360zc4&date=201401261\"><img src=\"http://p8.qhimg.com/t017508ca1f697413dd.jpg\"><em class=\"txt icon-play\"> </em><span class=\"txt-bg\"></span><span class=\"mask\"></span></a></div><div class=\"slide-item\"><a href=\"http://v.360.cn/yule/index.html?src=hao360zc4\"><img src=\"http://p9.qhimg.com/t01893d52e0b76c89b6.jpg\"><em class=\"txt icon-play\"> </em><span class=\"txt-bg\"></span><span class=\"mask\"></span></a></div></div><ul class=\"slide-nav\"><li class=\"selected\">0</li><li class=\"\">1</li><li class=\"\">2</li><li class=\"\">3</li></ul><a href=\"\" onclick=\"return false;\" class=\"slide-btn slide-pageup\" style=\"display: none;\"><span class=\"bg\"></span><em class=\"arrow\"><</em></a><a href=\"\" onclick=\"return false;\" class=\"slide-btn slide-pagedown\" style=\"display: none;\"><span class=\"bg\"></span><em class=\"arrow\">></em></a></li><li ><ins class=\"icon play\"></ins><a href=\"http://map.m.360.cn/t/e6tZ\" class=\" noactive \"> </a></li><li ><ins class=\"icon play\"></ins><a href=\"http://map.m.360.cn/t/eExZ\" class=\" noactive \"> </a></li><li ><ins class=\"icon play\"></ins><a href=\"http://map.m.360.cn/t/eQyZ\" class=\" noactive \"> </a></li><li ><ins class=\"icon play\"></ins><a href=\"http://map.m.360.cn/t/eiAZ\" class=\" noactive \"> </a></li>\t</ul>\t\r
需要:データの中の\を \t \r 全部入れ替えますvar r1 = /\\t/g;
var r2 = /\\r/g;
var r3 = /\
/g;
var r4 = /\\"/g;
temp = temp.replace(r1, "").replace(r2, "").replace(r3, "").replace(r4, "\"");