Home  >  Article  >  Web Front-end  >  How to replace the & character with "&:" using js_javascript skills

How to replace the & character with "&:" using js_javascript skills

WBOY
WBOYOriginal
2016-05-16 19:25:031906browse

var re = /&/g;
var str = "http://www.163.com?id=333&r=999&o=000";

str.replace(re,"&");

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn