![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JavaScript
comelyyyyy
这个作者很懒,什么都没留下…
展开
-
JS给表格加行和JS操作HTML元素
其实很简单!!![code="java"]var t = document.getElementById('table_id');var tr = document.createElement('tr');var td = document.createElement('td');td.innerHTML = "name:";tr.appendChild(td);...2010-03-12 19:55:27 · 89 阅读 · 0 评论 -
判断file域大小的JS
[code="js"] function getFileSize(filePath) { var image=new Image(); image.dynsrc=filePath; alert(image.fileSize); } [/code]2010-03-12 22:58:46 · 87 阅读 · 0 评论 -
JSON转JS对象
[code="java"]var json1 = "{key:1,value:'one'}";var json_obj = eval("("+json1+")");alert(json_obj.value);[/code][code="java"]var json2 = "{[{key:1,value:'one'},{key:2,value:'two'}]}";2010-03-20 12:46:54 · 67 阅读 · 0 评论 -
一个JS
找个地方存下自己写的js2010-03-30 10:55:57 · 83 阅读 · 0 评论 -
根据元素ID得到元素所在的指定层的ID
根据元素ID得到元素所在的指定层的ID。[size=large]一个页面有很多层,验证的时候如果层是隐藏的就无法调用element.focus();[/size]以下代码找到层,让其显示然后focus[code="html"] New Document var div_name = ...2010-03-31 11:12:10 · 82 阅读 · 0 评论 -
模式对话框使用
[b]1,弹出模式对话框[/b][code="javascript"]window.showModalDialog(url,self,'dialogHeight=520px;dialogWidth=800px;center=yes;resizable=yes;scroll=yes;status=no;');[/code][b]2,对话框中的页面[/b][code="HTML...2010-04-06 16:08:09 · 70 阅读 · 0 评论 -
JS中的栈
[code="java"]var strs = [];strs.push("111111111");strs.push("222222222");alert(strs.pop());[/code]弹出“222222222”。2010-04-14 15:00:07 · 73 阅读 · 0 评论 -
js自制队列——FIFO
[code="java"]//js's queue by yjfunction js_queue(){ this.head = 0; this.arr = new Array();}js_queue.prototype.put = function(obj){ this.arr[this.arr.length] = obj;}js_queue.prototype...2010-04-15 09:30:59 · 136 阅读 · 0 评论