history

window.onpopstate is not working; nothing happens when I navigate back to page

人盡茶涼 提交于 2020-01-14 08:52:09
问题 I'm trying to add window.onpopstate on one of the pages on my site, but nothing is happening. I put this script on the page: <script type="text/javascript"> window.addEventListener('popstate', function(event) { if (event.state) { alert(event.state); } }, false); </script> I have also tried: <script type="text/javascript"> window.onpopstate = function() { alert("popped!"); } </script> However, I don't get any alerts when I navigate back to the page. 回答1: You get a popstate event only if you

Cannot find where I have a popstate loop creating multiple history entries

喜欢而已 提交于 2020-01-14 02:50:08
问题 I'm trying to create a single webpage that replaces the content of the main div when navigation links are clicked. I've been able to implement the pushstate function to replace the div content and change the url address pretty easily. I also am able to get the content to refresh when the back/forward buttons are clicked with the popstate function. However, now I click the first link and it works fine, I click the next link and it seems to apply 2 pushstates, the 3rd click, applies 3

router.push(),router.replace(),router.go()

人盡茶涼 提交于 2020-01-12 11:45:14
1.router.push(location)=====window.history.pushState 想要导航到不同的 URL,则使用 router.push 方法。这个方法会向 history 栈添加一个新的记录,所以,当用户点击浏览器后退按钮时,则回到之前的 URL。 // 字符串 router.push('home') // 对象 router.push({ path: 'home' }) // 命名的路由 router.push({ name: 'user', params: { userId: 123 }}) // 带查询参数,变成 /register?plan=private router.push({ path: 'register', query: { plan: 'private' }}) 2.router.replace(location)=====window.history.replaceState 跟 router.push 很像,唯一的不同就是,它不会向 history 添加新记录,而是跟它的方法名一样 —— 替换掉当前的 history 记录 3.router.go(n)====window.history.go // 在浏览器记录中前进一步,等同于 history.forward() router.go(1) // 后退一步记录,等同于

Where does '.' and '..' come from?

霸气de小男生 提交于 2020-01-11 17:10:08
问题 What's the story behind our massive repitition of ./foo and cd .. . Where do these two . and .. come from? Where could they be seen as a way of navigating a file system tree for the first time? 回答1: Excerpt from an interview with Ken Thompson (9-6-89): Every time we made a directory, by convention we put it in another directory called directory - directory, which was dd. Its name was dd and that all the users directories and in fact most other directories, users maintain their own directory

关于mysql 删除数据后物理空间未释放

孤街醉人 提交于 2020-01-09 01:25:07
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> OPTIMIZE TABLE 当您的库中删除了大量的数据后,您可能会发现数据文件尺寸并没有减小。这是因为删除操作后在数据文件中留下碎片所致。OPTIMIZE TABLE 是指对表进行优化。如果已经删除了表的一大部分数据,或者如果已经对含有可变长度行的表(含有 VARCHAR 、 BLOB 或 TEXT 列的表)进行了很多更改,就应该使用 OPTIMIZE TABLE 命令来进行表优化。这个命令可以将表中的空间碎片进行合并,并且可以消除由于删除或者更新造成的空间浪费 。 OPTIMIZE TABLE 命令只对 MyISAM 、 BDB 和 InnoDB 表起作用 。表优化的工作可以每周或者每月定期执行,对提高表的访问效率有一定的好处,但是需要注意的是,优化表期间会锁定表,所以一定要安排在空闲时段进行。 一,原始数据 mysql> select count(*) as total from ad_visit_history; +---------+ | total | +---------+ | 1187096 | //总共有118万多条数据 +---------+ 1 row in set (0.04 sec) 2,存放在硬盘中的表文件大小 [root@BlackGhost test1]# ls |grep

实例说明optimize table在优化mysql时很重要

浪尽此生 提交于 2020-01-09 01:21:24
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 实例说明optimize table在优化mysql时很重要 张映 发表于 2011-03-07 分类目录: mysql 今天在看CU的时候,发现有人问有关optimize来表优化的问题,当年因为这个问题,困扰我很长一段时间,今天有空我把这个问题,用实际数据来展示出来,让大家可以亲眼来看看,optimize table的重要作用,而不是似是而非的估计了。 一,原始数据 1,数据量 查看复制打印? mysql> select count(*) as total from ad_visit_history; +---------+ | total | +---------+ | 1187096 | //总共有118万多条数据 +---------+ 1 row in set (0.04 sec) 2,存放在硬盘中的表文件大小 查看复制打印? [root @BlackGhost test1]# ls |grep visit |xargs -i du {} 382020 ad_visit_history.MYD //数据文件占了380M 127116 ad_visit_history.MYI //索引文件占了127M 12 ad_visit_history.frm //结构文件占了12K 3,查看一下索引信息

关于mysql 删除数据后物理空间未释

丶灬走出姿态 提交于 2020-01-09 01:21:06
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> OPTIMIZE TABLE 当您的库中删除了大量的数据后,您可能会发现数据文件尺寸并没有减小。这是因为删除操作后在数据文件中留下碎片所致。OPTIMIZE TABLE 是指对表进行优化。如果已经删除了表的一大部分数据,或者如果已经对含有可变长度行的表(含有 VARCHAR 、 BLOB 或 TEXT 列的表)进行了很多更改,就应该使用 OPTIMIZE TABLE 命令来进行表优化。这个命令可以将表中的空间碎片进行合并,并且可以消除由于删除或者更新造成的空间浪费 。 OPTIMIZE TABLE 命令只对 MyISAM 、 BDB 和 InnoDB 表起作用 。表优化的工作可以每周或者每月定期执行,对提高表的访问效率有一定的好处,但是需要注意的是,优化表期间会锁定表,所以一定要安排在空闲时段进行。 一,原始数据 mysql> select count(*) as total from ad_visit_history; +---------+ | total | +---------+ | 1187096 | //总共有118万多条数据 +---------+ 1 row in set ( 0.04 sec) 2,存放在硬盘中的表文件大小 [root @BlackGhost test1]# ls |grep

Pycharm误删代码找回方法

倖福魔咒の 提交于 2020-01-07 21:51:52
Pycharm误删代码找回方法 1. 找回一个文件中的代码 右键单击这个文件名,选择Local History->Show History,然后找到之前的版本,选出要恢复的代码,右键选择Accept即可 2、找回一个文件 右键点击你的project(worker)->Local History->Show History,操作类似1。 就能看到近期(一个月左右)的所有修改的过程,你就可以点击查看,恢复你删除的文件或者代码. 来源: CSDN 作者: 判官╰_╯ 链接: https://blog.csdn.net/weixin_44624410/article/details/103881840

Historical perspective to Linux Filesystems

夙愿已清 提交于 2020-01-06 06:28:34
问题 Jonathan Leffler's comment in the question "How can I find the Size of some specified files?" is thought-provoking. I will break it into parts for analysis. -- files are stored on pages; you normally end up with more space being used than that calculation gives because a 1 byte file (often) occupies one page (of maybe 512 bytes). The exact values vary - it was easier in the days of the 7th Edition Unix file system (though not trivial even then 4-5. if you wanted to take account of indirect

GWT History Problem

孤街醉人 提交于 2020-01-05 04:36:32
问题 when i am adding a new history item like this History.newItem("Register"); the url correcly changes to http://127.0.0.1:8888/BiddingSystem.html?gwt.codesvr=127.0.0.1:9997#Register and loads the register form but then the url automatically rechanges to http://127.0.0.1:8888/BiddingSystem.html?gwt.codesvr=127.0.0.1:9997# why?? because I want to remain as http://127.0.0.1:8888/BiddingSystem.html?gwt.codesvr=127.0.0.1:9997#Register so that user can reload 回答1: The problem is that I was using an