替换全部字符串

<!DOCTYPE html>
<html>
<body>

<p>Click the button to replace "Microsoft" with "W3CSchool" in the paragraph below:</p>

<p id="demo">{"page_idx":0,"goods_per_page":15,"cityid":"100010000","locate_city_id":"200010000","timestamp":1434463573064,"page_type":"component","fst_cattag_id":"330","sort_type":"0","labelid":"0","priceRange":""}</p>

<button onclick="myFunction()">Try it</button>

<script>
function parseParam(param)
{
var result = param.replace(new RegExp("\"",'gm'),'').replace(new RegExp("{",'gm'),'').replace(new RegExp("}",'gm'),'').replace(new RegExp(":",'gm'),'').replace(new RegExp(",",'gm'),'');
return result;
}
</script>

</body>
</html>
			

你可能感兴趣的:(字符串)