我现在有这个网址的地址栏window.location.href不工作,国防部重写或jQuery的?
http://localhost/cp/subscribed&type=topics
当我点击search-button-cp
应该加上&search=$term
$(".search-button-cp").live("click", function() {
var url = $(this).parents(".search-container:first").attr("data-url");
var search = $(this).parents(".search-container:first").find(".search-input-cp").val();
window.location.href = url + "&search=" + search;
});
,而不是我得到这个网址
http://localhost/cp/localhost/cp/subscribed&type=topics&search=car
我alert(url)
,我得到localhost/cp/subscribed&type=topics
...所以有什么问题?
应该重定向到该网址localhost/cp/subscribed&type=topics&search=car
如何解决这个问题?
这里是我的国防部重写柜面它是罪魁祸首
RewriteRule ^cp/([A-Za-z0-9-]+)?(/[A-Za-z0-9-]+)?(/[A-Za-z0-9-]+)?([^.]+)?/?$ /cp.php?o=$1&id=$2&p=$3&query=$4 [L]
当你指定GET参数,你应该把一个**之前的第一个,不是** **? – Greg