getAttribute 和 setAttribute 是一套, 直接使用属性是一套,两套完成不是一回事
如果是自定义属性,那统一使用 getAttribute , setAttribute ,保持浏览器兼容性
分类:
编程语言 时间:
2014-08-19 16:18:14
阅读次数:
218
js创建一个元素hiddenElementhiddenElement.setAttribute('href','')hiddenElement.setAttribute('target','_self')hiddenElement.click();这种写法在IE8下好用,但是IE8+就不好用了貌似I...
html5 自定义数据属性 ,也就是 data-* 自定义属性。 例如 可以有三种方法访问和修改data: 1.使用getAttribute setAttribute 方法 例如 div.getAttribute("data-last-value") 2.使用datase...
分类:
Web程序 时间:
2014-08-13 12:39:26
阅读次数:
153
HttpSessionsession=request.getSession();session.setAttribute("sessions",session);response.sendRedirect("***.jsp");在****.jsp中通过sessions取到session对象;<ahref="在web.xml中配置sess?name=${一个对象}">你好</a>?模拟传值web.xml配置<servlet>&..
分类:
Web程序 时间:
2014-08-12 10:31:14
阅读次数:
216
>在这样的一个场景中 `a.jsp` 中使用 `jsp:include`在多处引入了 `b.jsp`,但是在`b.jsp`中有一部分只需要执行一次(引入一次);那么这个时候就可以使用 `request.setAttribute`来完成 ### 在`a.jsp`中有这样一段代...
分类:
Web程序 时间:
2014-08-12 09:07:54
阅读次数:
221
document.getElementById('eastFrame').setAttribute('src','#'); // this will copy father window to this iframe(function() { Grs = function() { ...
分类:
编程语言 时间:
2014-08-08 12:23:45
阅读次数:
170
1. 操作"元素属性"我们可以使用javascript中的getAttribute和setAttribute来操作元素的"元素属性".在jQuery中给你提供了attr()包装集函数, 能够同时操作包装集中所有元素的属性:名称说明举例attr( name )取得第一个匹配元素的属性值。通过这个方法可...
分类:
Web程序 时间:
2014-08-08 12:06:55
阅读次数:
351
request.getAttribute():是request时设置的变量的值,用request.setAttribute("name","您自己的值");来设置值,
request.getParameter():提取发送过来的参数如:本网页
request.getParameter
是用来接受来自get方法或post方法的参数
ok
只能接受java.lang.String
...
分类:
其他好文 时间:
2014-08-07 18:59:00
阅读次数:
189
attribute和property这两个单词,都有属性的意思,attribute有属性、特质的意思,property则有性质,性能的意思。首先需要明确的是,在规范中,读取和设置attribute的方法是getAttribute/setAttribute/removeAttribute,比如box....
分类:
编程语言 时间:
2014-08-07 13:01:40
阅读次数:
292
setAttribute(String name,Object):设置名字为name的request的参数值
getAttribute(String name):返回由name指定的属性值
getAttributeNames():返回request对象所有属性的名字集合,结果是一个枚举的实例
getCookies():返回客户端的所有Cookie对象,结果是一个Cookie数组
...
分类:
其他好文 时间:
2014-08-06 19:08:42
阅读次数:
164