解决ie6下Javascript页面跳转和表单提交问题
经常在ie6下出现javascript页面跳转和表单提交问题,ie6下实现javascript页面跳转和表单提交需要进行特别处理,需要使用setTimeout()函数延迟实现。
1,兼容各浏览器的Javascript页面跳转
setTimeout(function(){
window.location.href = url;
},0);
2,兼容各浏览器的Javascript表单提交
setTimeout(function(){
form.submit();
},0);
相关文档:
Javascript网页打印大全
2010-04-09 09:30
普通打印(整页打) 打印网页内部分内容(自定义) 打印去掉/添加页眉页脚 使用外部控件/方法实现多功能打印 & ......
返回一个给定id属性值的元素节点的对象
document.getElememtById(id)
返回一个包含所有给定标签的元素的数组
document.getElementsByName(tag)
获取元素属性
document.getAttribute(attribute)
设置元素属性值
document.setAttribute(attribute)
......
function Search(){
//如果前一个控件的值大于后一个控件的值(前提是后一个控件不是空,空的情况下不做任何处理)
if(document.forms[0].koteifrom.value > document.forms[0].koteiTo.value && document.forms[0].koteiTo.value != ""){
alert('message内容');
var koteifrom ......
一、document.formName.item(“itemName”) 问题
问题说明:IE下,可以使用 document.formName.item(“itemName”) 或 document.formName.elements ["elementName"];Firefox下,只能使用document.formName.elements["elementName"]。
解决方法:统一使用document.formName.elements["elementName" ......