例子:比如:现在有三个页面:test1.html,test2.html,test.html从test1.html,test2.html可以跳转到test.html,从test.html可以根据不同的来源返回到上个页面,代码如下:==================================test1.html<html><body><a href="test.html?str=test1">这是test1页面,点击跳转到test.html</a></body></html>==================================test2.html<html><body><a href="test.html?str=test2">这是test2页面,点击跳转到test.html</a></body></html>==================================test.html<html><head><script>var request ={QueryString : function(val){var uri = window.location.search;var re = new RegExp("" +val+ "=([^&?]*)", "ig");return ((uri.match(re))?(uri.match(re)[0].substr(val.length+1)):null);}}var rurl=request.QueryString("str");</script></head><body><a href="#" onClick="javascript:location.href=rurl+'.html';">返回上个页面</a></body></html>==================================注:<a href="test.html?str=test1">这里的str=test1以及后面的就是取的页面名test1.html,如果是别的名字要注意更换,test2.html里面也一样