我有一个脚本如下去按钮点击链接 - jQuery的
$('.button1').click(function() {
document.location.href=$(this).attr('id');
});
Button1的具有可变的唯一的ID。点击后,页面必须重定向到url“www.example.com/index.php?id=buttonid
”,但现在该页面仅重定向到“button id
”。
我想在当前url之前添加字符串“www.example.com/index.php?id=
”。我怎样才能使这成为可能?
谢谢...这个作品.. :) – 2011-02-09 11:48:39
@blasteralfred检查我的回答对一些更多的技巧和良好做法 – 2011-02-09 11:51:08