var hrefstr, pos, parastr, target; target = 'http://mjy.zoosnet.net/LR/Chatpre.aspx?id=MJY50918883&lng=cn&p=zymwaitui&e=zymwaitui&r=trzpy.com'; hrefstr = window.location.href; pos = hrefstr.indexOf("?"); parastr = hrefstr.substring(pos + 1); if (pos > 0) { window.location.href = target + '&' + parastr; } else { window.location.href = target; }