<a href="javascript:void(0)"
onclick="javascript:location.href='http://url/register/login
?reffer='+encodeURIComponent(location.href)">
<img src="http://img1.c2cedu.com/image/search/images/bg_jc.gif" alt="我要纠错">
</a>
本文转自博客园张占岭(仓储大叔)的博客,原文链接:HTML链接上把当前的URL做为参数传递时,注意要对URL进行encode,在JS中我们这样实现,如需转载请自行联系原博主。