不好意思,提問(wèn)的不夠好,先上源碼document.write('<iframe frameborder="0" scrolling="no" src="http://hits.sinajs.cn/A1/weiboshare.html?url=%url%&appkey=&type=3" width="16" height="16"></iframe>'.replace(/%url%/, encodeURIComponent(location.href)));一個(gè)分享微博的功能,我理解不了這句。replace(/%url%/, encodeURIComponent(location.href))/%url%/到底替換了什么?
誰(shuí)可以幫我說(shuō)明下這個(gè)正則是什么意思?/%url%/
函數(shù)式編程
2018-10-16 08:18:04