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

  var re = /&/g;

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

  str.replace(re,"&");