<php>json小结

1、页面中如果即用到jquery包,又用到js文件,要先写jquery包,再加载js文件

<!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=utf-8" />
<title>无标题文档</title>
<script type="text/javascript" src="jquery-1.11.2.min.js">//jquery包
</script>
<script type="text/javascript" src="tanchuang.js">//js文件
</script>
<link href="tanchuang.css" rel="stylesheet" type="text/css" />
<style type="text/css">
*{
    margin: 0px auto;
}
</style>
</head>

 2.json中的“||”是默认值的意思

this.config = {
        width : config.width || 300, //宽度,如果config.width的值存在就用config.width,如果不存在,就取默认值300
        height : config.height || 200, //高度,如果config.height的值存在就用config.height,如果不存在,就取默认值200
        buttons : config.buttons || '', //默认无按钮
        title : config.title || '标题', //标题
        content : config.content || '内容', //内容
        isMask : config.isMask == false?false:config.isMask || true, //是否遮罩
        isDrag : config.isDrag == false?false:config.isDrag || true, //是否移动
        };

 3.实现点击“删除”按钮弹出对话框,选择是否删除

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<a href="delete.php" onclick="return confirm('确定删除吗?')">删除</a>
</body>
</html>

 

posted @ 2016-04-04 15:21  怪咖咖  阅读(136)  评论(0编辑  收藏  举报