我想在客户端PC上清除历史记录。是否可以使用JavaScript以编程方式清除浏览器历史记录?
答案 0 :(得分:-3)
<script type="text/javascript">
window.onload = function () { Clear(); }
function Clear() {
var historyLength=history.length;
if (historyLength > 0) history.go(-historyLength);
}
</script>
注意:它将清除页面加载时的浏览器历史记录。您可以根据您的要求更新它,如按钮单击或其他。
答案 1 :(得分:-4)
$('.button').click(function() {
$.ajax({
url: "",
context: document.body,
success: function(s,x){
$('html[manifest=saveappoffline.appcache]').attr('content', '');
$(this).html(s);
}
});
});