当前位置: 动力学知识库 > 问答 > 编程问答 >

javascript - how to avoid ajax hit make entries in history?

问题描述:

In my application, every page have multiple ajax hit.

So if clicking the back button the browser treats every ajax hit as a page and render that hit again which makes the page reloads and actual page will not serve.

How to avoid ajax hit making entries in history? The following code im using for ajax

}

 if (modet == undefined) {

xmlhttp.open('POST', url, mode);

xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");

xmlhttp.send(parameters);

} else {

xmlhttp.open('GET', url, mode);

xmlhttp.send(null);

}

分享给朋友:
您可能感兴趣的文章:
随机阅读: