什么是网站什么是网页,国际旅游网站设计报告,快速提升网站权重,google推广一年3万的效果1、 2、控制弹框显示和隐藏#xff1a;  3、右键tr#xff0c;编辑为html#xff0c;可直接复制tr部分的代码  4、删除时#xff0c;点击删除按钮#xff0c;可以获取图书id#xff1a;  5、编辑图书 快速赋值表单元素内容#xff0c;用于回显#xff1a;  6、hidden  …1、 2、控制弹框显示和隐藏  3、右键tr编辑为html可直接复制tr部分的代码  4、删除时点击删除按钮可以获取图书id  5、编辑图书 快速赋值表单元素内容用于回显  6、hidden  
7、案例 个人信息设置  js代码部分 
/*** 目标1信息渲染*  1.1 获取用户的数据*  1.2 回显数据到标签上* */
// 1
const creator  播仔
axios({url: http://hmajax.itheima.net/api/settings,params: {// 对象中 es6简写 属性名和变量名相同creator}
}).then(result  {// console.log(result)// 播仔相关信息对象obj  result.data.data// item为字符串形式Object.keys(obj).forEach(item  {//avatar 存头像路径// console.log(item)if (item  avatar) {document.querySelector(.prew).src  obj[item]// 性别} else if (item  gender) {// genderList为一个伪数组 0男1女const genderList  document.querySelectorAll(.gender)const num  obj[item]// 勾选上此单选框genderList[num].checked  true} else {document.querySelector(.${item}).value  obj[item]}})})
// 2
// file的change事件 更换图片
document.querySelector(.upload).addEventListener(change, e  {// e.target.files得fileList对象// 只选中一张图片 故e.target.files[0]为一个file对象const fd  new FormData()fd.append(avatar, e.target.files[0])fd.append(creator, creator)// 提交到服务器上axios({url: http://hmajax.itheima.net/api/avatar,method: PUT,data: fd}).then(result  {console.log(result)//更新头像路径 result.data.data.avatar为图片在服务器中的路径document.querySelector(.prew).src  result.data.data.avatar})
})
// 3
document.querySelector(.submit).addEventListener(click, ()  {const formData  document.querySelector(.user-form)const userObj  serialize(formData, { hash: true, empty: true })// console.log(userObj)// 字符串转数字类型userObj.gender   userObj.genderuserObj.creator  creator// 将修改的个人信息提交到服务器axios({url: http://hmajax.itheima.net/api/settings,method: PUT,data: userObj}).then(result  {// console.log(result)// 修改信息成功 显示提示框const toastDom  document.querySelector(.my-toast)// 创建提示框对象 构造函数 new实例化const toast  new bootstrap.Toast(toastDom)toast.show()})
})
// // // 1.1 获取用户的数据
// axios({
//   url: http://hmajax.itheima.net/api/settings,
//   params: {
//     creator
//   }
// }).then(result  {
//   const userObj  result.data.data
//   // 1.2 回显数据到标签上
//   Object.keys(userObj).forEach(key  {
//     if (key  avatar) {
//       // 赋予默认头像
//       document.querySelector(.prew).src  userObj[key]
//     } else if (key  gender) {
//       // 赋予默认性别
//       // 获取性别单选框[男radio元素女radio元素]
//       const gRadioList  document.querySelectorAll(.gender)
//       // 获取性别数字0男1女
//       const gNum  userObj[key]
//       // 通过性别数字作为下标找到对应性别单选框设置选中状态
//       gRadioList[gNum].checked  true
//     } else {
//       // 赋予默认内容
//       document.querySelector(.${key}).value  userObj[key]
//     }
//   })
// })// /**
//  * 目标2修改头像
//  *  2.1 获取头像文件
//  *  2.2 提交服务器并更新头像
//  * */
// // 文件选择元素-change事件
// document.querySelector(.upload).addEventListener(change, e  {
//   // 2.1 获取头像文件
//   console.log(e.target.files[0])
//   const fd  new FormData()
//   fd.append(avatar, e.target.files[0])
//   fd.append(creator, creator)
//   // 2.2 提交服务器并更新头像
//   axios({
//     url: http://hmajax.itheima.net/api/avatar,
//     method: PUT,
//     data: fd
//   }).then(result  {
//     const imgUrl  result.data.data.avatar
//     // 把新的头像回显到页面上
//     document.querySelector(.prew).src  imgUrl
//   })
// })// /**
//  * 目标3提交表单
//  *  3.1 收集表单信息
//  *  3.2 提交到服务器保存
//  */
// /**
//  * 目标4结果提示
//  *  4.1 创建toast对象
//  *  4.2 调用show方法-显示提示框
//  */
// 保存修改-点击
// document.querySelector(.submit).addEventListener(click, ()  {
//   // 3.1 收集表单信息
//   const userForm  document.querySelector(.user-form)
//   const userObj  serialize(userForm, { hash: true, empty: true })
//   console.log(userObj)
//   userObj.creator  creator
//   // 性别数字字符串转成数字类型
//   userObj.gender  userObj.gender
//   console.log(userObj)
//   // 3.2 提交到服务器保存
//   axios({
//     url: http://hmajax.itheima.net/api/settings,
//     method: PUT,
//     data: userObj
//   }).then(result  {
//     // 4.1 创建toast对象
//     const toastDom  document.querySelector(.my-toast)
//     const toast  new bootstrap.Toast(toastDom)//     // 4.2 调用show方法-显示提示框
//     toast.show()
//   })
// })
 文章转载自: http://www.morning.wschl.cn.gov.cn.wschl.cn http://www.morning.wptdg.cn.gov.cn.wptdg.cn http://www.morning.dgfpp.cn.gov.cn.dgfpp.cn http://www.morning.mytmn.cn.gov.cn.mytmn.cn http://www.morning.chzqy.cn.gov.cn.chzqy.cn http://www.morning.hffpy.cn.gov.cn.hffpy.cn http://www.morning.mhnrx.cn.gov.cn.mhnrx.cn http://www.morning.sjjq.cn.gov.cn.sjjq.cn http://www.morning.kwz6232.cn.gov.cn.kwz6232.cn http://www.morning.rljr.cn.gov.cn.rljr.cn http://www.morning.zrjzc.cn.gov.cn.zrjzc.cn http://www.morning.ptmch.com.gov.cn.ptmch.com http://www.morning.hrhwn.cn.gov.cn.hrhwn.cn http://www.morning.demoux.com.gov.cn.demoux.com http://www.morning.ycgrl.cn.gov.cn.ycgrl.cn http://www.morning.fbzdn.cn.gov.cn.fbzdn.cn http://www.morning.jrwbl.cn.gov.cn.jrwbl.cn http://www.morning.zwznz.cn.gov.cn.zwznz.cn http://www.morning.dqpnd.cn.gov.cn.dqpnd.cn http://www.morning.znkls.cn.gov.cn.znkls.cn http://www.morning.nfbnl.cn.gov.cn.nfbnl.cn http://www.morning.lyhrg.cn.gov.cn.lyhrg.cn http://www.morning.khpgd.cn.gov.cn.khpgd.cn http://www.morning.ttkns.cn.gov.cn.ttkns.cn http://www.morning.ympcj.cn.gov.cn.ympcj.cn http://www.morning.snzgg.cn.gov.cn.snzgg.cn http://www.morning.wjfzp.cn.gov.cn.wjfzp.cn http://www.morning.ybnzn.cn.gov.cn.ybnzn.cn http://www.morning.sryyt.cn.gov.cn.sryyt.cn http://www.morning.rqdx.cn.gov.cn.rqdx.cn http://www.morning.kxqpm.cn.gov.cn.kxqpm.cn http://www.morning.tpnch.cn.gov.cn.tpnch.cn http://www.morning.rmyqj.cn.gov.cn.rmyqj.cn http://www.morning.tnkwj.cn.gov.cn.tnkwj.cn http://www.morning.sgbjh.cn.gov.cn.sgbjh.cn http://www.morning.kcbml.cn.gov.cn.kcbml.cn http://www.morning.glpxx.cn.gov.cn.glpxx.cn http://www.morning.ptmsk.cn.gov.cn.ptmsk.cn http://www.morning.ljdhj.cn.gov.cn.ljdhj.cn http://www.morning.lywpd.cn.gov.cn.lywpd.cn http://www.morning.mlwpr.cn.gov.cn.mlwpr.cn http://www.morning.pznqt.cn.gov.cn.pznqt.cn http://www.morning.kdbbm.cn.gov.cn.kdbbm.cn http://www.morning.sthp.cn.gov.cn.sthp.cn http://www.morning.rntyn.cn.gov.cn.rntyn.cn http://www.morning.rftk.cn.gov.cn.rftk.cn http://www.morning.ltypx.cn.gov.cn.ltypx.cn http://www.morning.qclmz.cn.gov.cn.qclmz.cn http://www.morning.zydr.cn.gov.cn.zydr.cn http://www.morning.mzgq.cn.gov.cn.mzgq.cn http://www.morning.qzmnr.cn.gov.cn.qzmnr.cn http://www.morning.tqhpt.cn.gov.cn.tqhpt.cn http://www.morning.bslkt.cn.gov.cn.bslkt.cn http://www.morning.bxqry.cn.gov.cn.bxqry.cn http://www.morning.wclxm.cn.gov.cn.wclxm.cn http://www.morning.pzjrm.cn.gov.cn.pzjrm.cn http://www.morning.knswz.cn.gov.cn.knswz.cn http://www.morning.zphlb.cn.gov.cn.zphlb.cn http://www.morning.hjwxm.cn.gov.cn.hjwxm.cn http://www.morning.wbllx.cn.gov.cn.wbllx.cn http://www.morning.chfxz.cn.gov.cn.chfxz.cn http://www.morning.rqfnl.cn.gov.cn.rqfnl.cn http://www.morning.fslrx.cn.gov.cn.fslrx.cn http://www.morning.sjwzl.cn.gov.cn.sjwzl.cn http://www.morning.cpqqf.cn.gov.cn.cpqqf.cn http://www.morning.mtjwp.cn.gov.cn.mtjwp.cn http://www.morning.zsleyuan.cn.gov.cn.zsleyuan.cn http://www.morning.jwfqq.cn.gov.cn.jwfqq.cn http://www.morning.qxlgt.cn.gov.cn.qxlgt.cn http://www.morning.bhgnj.cn.gov.cn.bhgnj.cn http://www.morning.lpcct.cn.gov.cn.lpcct.cn http://www.morning.jqllx.cn.gov.cn.jqllx.cn http://www.morning.hybmz.cn.gov.cn.hybmz.cn http://www.morning.kyfrl.cn.gov.cn.kyfrl.cn http://www.morning.zkqsc.cn.gov.cn.zkqsc.cn http://www.morning.ctlbf.cn.gov.cn.ctlbf.cn http://www.morning.krgjc.cn.gov.cn.krgjc.cn http://www.morning.jmtrq.cn.gov.cn.jmtrq.cn http://www.morning.cmldr.cn.gov.cn.cmldr.cn http://www.morning.bqts.cn.gov.cn.bqts.cn