`
ghost_away
  • 浏览: 17172 次
文章分类
社区版块
存档分类
最新评论

js知识点

 
阅读更多
1.ajax异步提交
list.cancelConnect=function(cwaId){
$.ajax({
type:"get",
url:"online_pauseRecord.do?cwaId="+cwaId,
dataType:"json",//获得定义的json对象,dataType必须定义
success:function(data){

if(data.success){
$('#disconnect').dialog('close');
$("#toDealTable").datagrid("reload");
}else{
alert(data.msg);
}

},
error:function(data){
alert(data.msg);
}
});
};
2.setTimeout自调用更新数据库
<script type="text/javascript" charset="gbk">
$(function(){
refleshDataBase();
});
function refleshDataBase(){
$.ajax({
type:"get",
url:"online_refleshDatabase.do",
success:function(r){
$("#toDealTable").datagrid("reload");
}
});
setTimeout("refleshDataBase()",20000);

}
</script>

3.document.all//判断是否是ie浏览器,这是ie浏览器的属性
$(function(){
// Ech适配
if(document.all){//ie  $("#parentIframe").css("width",$(document.body).width()-180+"px");    $("#parentIframe").css("height",$(document.body).height()-60+"px");
}else{//其他浏览器 $("#parentIframe").css("width",document.documentElement.clientWidth-180+"px");
$("#parentIframe").css("height",document.documentElement.clientHeight-60+"px");
}
$("#parentIframe").attr("src",zr.root()+"/user_remindTab.do");
});
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics