上一页 1 2 3 4 5 6 ··· 11 下一页
摘要: 使用cookie,使用web worker,使用localeStorage和sessionStorage cookie,兼容性很好,但是大概4kb.同时,cookie可以永久存在,也可以再回话结束后结束。要就关闭标签页回话立即结束时,不要用cookie,因为它还很有可能会存在一段时间,即使是sess 阅读全文
posted @ 2017-02-20 11:45 sunli0205 阅读(6985) 评论(0) 推荐(1) 编辑
摘要: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume that the 阅读全文
posted @ 2017-01-14 14:39 sunli0205 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 1.实现拖放的步骤 ①将对象的属性设置为可拖放,即draggable=“true” ②编写有关拖放事件的处理函数。 2.使用dataTransfer对象 dataTransfer对象是事件对象的一个属性,用于从被拖拽元素向放置目标传递字符串格式的数据。因为是事件对象的属性,在拖放事件的事件处理程序中 阅读全文
posted @ 2017-01-08 17:03 sunli0205 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 一 File对象与FileList对象 当将input元素的type类型设置为file时,web页面上会显示一个选择文本按钮和一个文本显示框,单击文件按钮可以选择一个文件,文本显示框中会显示选中的文件名称。 input元素设置multiple属性,可以选择多个文件,文本显示框中会显示选中了几个文件。 阅读全文
posted @ 2017-01-08 14:21 sunli0205 阅读(2004) 评论(0) 推荐(0) 编辑
摘要: Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. This 阅读全文
posted @ 2017-01-07 20:26 sunli0205 阅读(176) 评论(0) 推荐(0) 编辑
摘要: HashSet 1.底层数据结构是哈希表。 2.哈希表依赖两个方法: hashCode()和equals() 执行顺序: 首先判断hashCode()值是否相同 相同:继续执行equals(),看其返回值 返回true:说明元素重复,不添加 返回false:说明不重复,就直接添加到集合 不相同:就直 阅读全文
posted @ 2017-01-07 20:13 sunli0205 阅读(174) 评论(0) 推荐(0) 编辑
摘要: Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: 分析:找出字符串中第一次出现且不重复的字符,返回 阅读全文
posted @ 2017-01-06 17:13 sunli0205 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 在链接列表中删除节点. 编写一个函数来删除单链表中的一个节点(除了尾部),只提供对该节点的访问.。假设链表是1 - > 2 - > 3 > 4,并给出了具有值为3的节点, 链表应该成为1 - > 2 - > 4 阅读全文
posted @ 2017-01-06 15:03 sunli0205 阅读(140) 评论(0) 推荐(0) 编辑
摘要: html5中新增两个表单属性,分别autocomplete和novalidate属性 1.autocomplete属性 该属性用于控制自动完成功能的开启和关闭。可以设置表单或者input元素,有两个属性值,当设置为on时,启动该功能;当设置off时,关闭该功能。启用该功能后,当用户在自动完成域开始输 阅读全文
posted @ 2017-01-06 11:24 sunli0205 阅读(12227) 评论(0) 推荐(2) 编辑
摘要: 一 .新增的input输入属性 1.email类型 在表单提交E-mail地址时,无效的输入会生成很多无效数据,对后期的数据检索造成一定的影响。所以在表单提交之前,需要对输入的E-mail地址进行有效性进行验证。早期的实现方式都是通过正则表达式和JavaScript进行验证,HTML5中,使用ema 阅读全文
posted @ 2017-01-05 17:10 sunli0205 阅读(205) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 11 下一页