文章分类 - Javascript
摘要:区别 代码放在head和body中主要是dom的加载顺序 如果是调用方法可以直接放在head中,因为此时dom元素已经加载完毕 如果是希望直接加载dom对象建议放在body中 代码演示 <html> <head> <title>Test</title> <style type="text/css">
阅读全文
摘要:学习笔记 js代码放在head和body的区别 代码实操
阅读全文
摘要:冒泡排序 // 创建列表类 function ArrayList() { this.array = []; ArrayList.prototype.insert = function (item) { this.array.push(item); } ArrayList.prototype.toSt
阅读全文
摘要:树结构 function BinarySearchTree() { function Node(key) { this.key = key; this.left = null; this.right = null; } // 属性 this.root = null; BinarySearchTree
阅读全文
摘要:创建哈希函数 // 讲字符串转换成大的数字 // 数组大小 function hashFunc(str,size) { var hashCode = 0; for(var i=0;i<str.length;i++){ hashCode = 37 * hashCode + str.charCodeAt
阅读全文
摘要:function Set() { this.items = {}; Set.prototype.add = function(value) { // 判断当前集合是否包含某个元素 if(this.has(value)) { return false; } this.items[value] = va
阅读全文
摘要:// 双向链表 function DoublyLinkedList() { function Node(data) { this.data = data; this.prev = null; this.next = null; } // 当前头部 this.head = null; // 当前尾部
阅读全文
摘要:function LinkedList() { function Node(data){ this.data = data; this.next = null; } // 头部 this.head = null; this.length = 0; // 追加方法 LinkedList.prototy
阅读全文
摘要:function Queue() { this.items = []; Queue.prototype.enqueue = function (item) { this.items.push(item); } Queue.prototype.dequeue = function () { retur
阅读全文
摘要:function Stack() { this.items = []; Stack.prototype.push = function(element) { this.items.push(element); } Stack.prototype.pop = function() { return t
阅读全文
摘要:demo.css *{ margin: 0 auto; padding: 0; font-family: "Microsoft YaHei","sans-serif"; } .container{ margin-top:20px; } .btn { padding: 5px 10px; } inde
阅读全文
摘要:系统函数 escape() 字符串转换成通用的unicode字符集 unescape() 解码 isFinite() 判断一个数字是否是有限的 isNaN() 判断一个变量是否为非数字 parseFloat() 把字符串前缀数字转换成浮点型 parseInt() 把字符串前缀数字转换成整型 eval
阅读全文
摘要:知识点 form提交表单时可以配合"submit"按钮使用 button内嵌标签只能通过如下方式设置,不能用input方式设置 代码如下: <html> <head> <title>bing Search</title> <style type="text/css"> body { backgrou
阅读全文

浙公网安备 33010602011771号