我有一個腳本如下去按鈕點擊鏈接 - 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