摘要:
有人喜欢用ie,有人喜欢用firefox,还有人喜欢用260,虽然名字可能有很多种,但是内核只有几种.ie内核,netscape内核!怎么用js来判断各种浏览器的类型呢?在不同的浏览器中对js的支持程度,语法要求都大不一样,下面的代码为判断代码:<script type="text/javascript"> var getOs=function(){ var OsObject=""; if(navigator.userAgent.indexOf("MSIE")>0){ return "MSIE"; 阅读全文
随笔分类 - Javascript
js修改css样式表解析(转)
2012-09-12 10:22 by hongjiumu, 538 阅读, 收藏,
摘要:
js修改css样式表解析(转)2009-12-30 14:57abc.cssCSS code.class1{width:10px;background-color: red;}HTML code<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><link rel="stylesheet" type="text/css" href="abc.css" /><TITLE 阅读全文
javascript获取的层(div)高度
2012-09-12 10:21 by hongjiumu, 420 阅读, 收藏,
摘要:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=gb23 阅读全文
(转)javascript选择id class
2012-09-12 10:20 by hongjiumu, 1068 阅读, 收藏,
摘要:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><title> 使用javascript通过className来获取元素 </title><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /></head><style>.red{color: #F00;}# 阅读全文
使用this作为方法的参数
2012-09-08 10:18 by hongjiumu, 453 阅读, 收藏,
摘要:
<table><tbody> <tr id="test"><td></td></tr></tbody></table>document.getElementById("test").setAttribute("onclick","Test()");var Test=function(){ alert(Object.prototype.toString.call(this));};结果显示: [object Window] 阅读全文
js做带编辑,保存,删除,添加功能的表格
2012-09-06 19:18 by hongjiumu, 723 阅读, 收藏,
摘要:
<!--产品属性处理部分开始--> <table id="productAttributeBlock" class="tabEditList" style="width:100%;"> <thead> <tr> <th> 属性类型 </th> <th> ... 阅读全文
<input type="text"> 的document.getElementById("").value和document.getElementById("").getAttribute("value")不相同
2012-09-06 18:07 by hongjiumu, 4729 阅读, 收藏,
摘要:
<!--产品属性处理部分开始--> <table id="productAttributeBlock" class="tabEditList" style="width:100%;"> <thead> <tr> <th> 属性类型 </th> <th> ... 阅读全文
Js中冒号的作用
2012-09-05 09:31 by hongjiumu, 597 阅读, 收藏,
摘要:
Js中冒号的作用:1,声明对象的成员;2,switch语句的分支;3, 三元表达式。(1)声明对象的成员:var Book={ Name:'法', Price:100, Discount:function(rate){ this.Price*=rate; }};alert(Book.Price);Book.Discount(0.8);alert(Book.Price);2.switch语句分支vara=2;switch(a){ case0: alert('0'); break; case1: alert('1'); break; case2: a 阅读全文
getElementById() dosen't find <input type="hidden" runat="server"/>
2012-09-04 10:36 by hongjiumu, 383 阅读, 收藏,
摘要:
getElementById() dosen't find <input type="hidden" runat="server"/><asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><input id="divPosition" type="hidden" value="12" 阅读全文
(转)Javascript如何正确使用getElementById,getElementsByName() and getElementsByTagName()
2012-09-03 23:29 by hongjiumu, 618 阅读, 收藏,
摘要:
Web标准下可以通过getElementById(),getElementsByTagName() and getElementsByName()访问Document中的任一个标签。(1)getElementById():getElementById()可以访问Document中的某一特定元素,顾名思义,就是通过ID来取得元素,所以只能访问设置了ID的元素。(2)getElementsByName():getElementsByName()是通过Name属性来获得元素。但注意区别:getElementById()中是element,而getElementsByName是elements。显而易 阅读全文
(Transfered)DOM最常用的方法和属性(Javascript DOM编程艺术,DOM Scripting)
2012-09-02 16:04 by hongjiumu, 433 阅读, 收藏,
摘要:
What this section covers:Creating nodesDuplicating nodesInserting nodesRemoving nodesReplacing nodesManipulating nodesFinding nodesNode propertiesTraversing the node treeThis section contains a list of some of the most useful methods and properties provided by the Document Object Model.They are arra 阅读全文
Edit tbody
2012-08-29 10:04 by hongjiumu, 183 阅读, 收藏,
摘要:
You can't use innerHTML on parts of a table.innerHTML can only use to replace the entire table.stop using innerHTML,take some time and learn the DOM.<!--子窗口操作结果--> <div> <table class="innerTable"> <thead> <tr> <th> ... 阅读全文
js子窗口向父窗口传值
2012-08-28 19:14 by hongjiumu, 972 阅读, 收藏,
摘要:
用opener这是一个父窗口~<html><head><title></title><script language="javascript">function win(){window.open("login.html",null,"height=150,width=200");}</script></head><table id="t1"><tr><td id="dd">u 阅读全文
Ajax请求数据
2012-08-17 09:50 by hongjiumu, 5921 阅读, 收藏,
摘要:
<div> <input type="button" value="新增" onclick='location.href="ProductCategoryEdit.aspx?q=<%=GetEncryptQueryString("Action=Add") %>"' /> </div> <div id="pctree"> </div> <script type="text/javascript& 阅读全文
Object.prototype.toString()
2012-08-14 19:18 by hongjiumu, 206 阅读, 收藏,
摘要:
Transferred From :http://stackoverflow.com/questions/3250379/what-is-the-call-function-doing-in-this-javascript-statement/3250415#3250415The call method sets the this value of the invoked function to the object passed as first argument.All native object in Javascript contain an internal property cal 阅读全文
浙公网安备 33010602011771号