修改 html 标签属性
修改 checked 属性
var sex = '${entity.sex}';
if(sex == '男')
{
//document.all.sexCk1.checked=true; 这种火狐不支持
document.getElementById('sexCk1').checked = true;
document.getElementById('sexCk2').checked = false;
}else if(sex == '女'){
document.getElementById('sexCk1').checked = false;
document.getElementById('sexCk2').checked = true;
}
修改 class 属性
// 处理课程进度
var progress = '<s:property value="progress" /> ';
//alert(' progress :'+progress);
if(progress >= 1){
document.getElementById('javase').className = 'passed';
}
if(progress >= 2){
document.getElementById('web').className = 'passed';
}
if(progress >= 3){
&nb
相关文档:
有时页面需要获得用户浏览器的高度才能确定内容显示在哪里,代码
<div style="position:absolute; left:0; top:expression(document.body.clientHeight/2-document.body.clientHeight/4)">
</div>
中,expression(document.body.clientHeight/2)即为获得浏览器高度再除以2 ......
//截取部分内容方法
public static string strvalue(string value, int length)
{
string strValue = NoHTML(value);// 去除HTML标记
&nb ......
Example:
1.<!--[if !IE]><!--> 除IE外都可识别 <!--<![endif]-->
2.<!--[if IE]> 所有的IE可识别 <![endif]-->
3.<!--[if IE 5.0]> 只有IE5.0可以识别 <![endif]-->
4.<!--[if IE 5]> 仅IE5.0与IE5.5可以识别 <![endif]-->
5.<!--[if gt IE 5.0]> IE ......
最近在使用ext嵌入html页面的过程中,遇到一个问题。我们页面都是用html制作的,用iframe的方式嵌入到ext的panel里。其中有一个页面是在按钮触发的时候加载进去的,但是重新刷新浏览器,页面仍然嵌入在panel中,并没有卸载掉,在页面上设置清空缓存也没有效果。
后来我发现,只有在浏览器地址里 ......