用js怎么把&字符换成"&amp:"

(编辑:jimmy 日期: 2024/10/14 浏览:2)

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

str.replace(re,"&");