使用书签可以实现以下目的吗?
我有这个,但它在firefox上无声地失败。我还没有尝试过其他浏览器:
javascript:(
function()
{
key = encodeURI('include_docs'); value = encodeURI('true');
var kvp = document.location.search.substr(1).split('&');
var i=kvp.length; var x; while(i--)
{
x = kvp[i].split('=');
if (x[0]==key)
{
x[1] = value;
kvp[i] = x.join('=');
break;
}
}
if(i<0) {kvp[kvp.length] = [key,value].join('=');}
//this will reload the page, it's likely better to store this until finished
document.location.search = kvp.join('&');
}()
);
答案 0 :(得分:5)
无需过度复杂化任何事情; - )
document.location += '&include_docs=true';
这应该可以解决问题。以书签形式:
javascript:(function(){document.location+='&include_docs=true'}());