ajax后退解决方案
使用iframe,通过修改iframe.src产生历史
01 <!DOCTYPE html>
02 <html>
03 <head>
04 <meta charset="utf-8" />
05 <title>0</title>
06 </head>
07 <body>
08 <input type="button" value="加1" onclick="add()" />
09 <div id="info" style="border:red 1px solid;width:200px;padding:10px;margin:5px;">0</div>
10 </body>
11
12 </html>
13 <script src="history-0.2.js"></script>
14 <script>
15 var info = document.getElementById('info');
16 var i = 1;
17 function add() {
18 info.innerHTML = i;
19 document.title = i;
20 var data = {
21 param : i,
22 func : func
23 };
24 History.push(data);
25 i++;
26 }
27
28 History.push({param:0, func: func});
29
30 function func(i) {
31 info.innerHTML = i;
32 document.title = i;
33 }
34 </script>