在下面,我试图从一个页面重定向到另一个页面与href属性被附加到URL链接。从一个页面重定向到其他href附加到重定向的url
<script src="jquery-1.11.3.js"></script>
<script>
$(document).ready(function(){
\t
\t $('a').click(function(){
\t var clk=$(this).attr('href');
\t //alert(clk);
\t window.location='http://www.shopeeon.com&ver='+clk;
\t });
});
</script>
<a href="http://www.gogle.com">Google</a><br/>
<a href="http://www.yahoo.com">Yahoo</a><br/>
<a href="http://www.rediff.com">Rediff</a><br/>
在上面的例子中的onclick第一我想HREF(即http://www.google.com,http://www.yahoo.com,..etc),其被存储在“CLK”变量和重定向到另一页(即http://shopeeon.com)与我们的链路被存储在“ clk“变量。
在我的情况下,当我点击链接而不是重定向到其他页面与附加链接它运行特定的href。
@HemalThanks了很多,它做工精细 – shopeeon
接受的答案,如果你喜欢它。 – Hemal
上面追加变量的格式(window.location ='http://www.shopeeon.com&ver='+clk;)无法正常工作 – shopeeon