2017年2月20日

try-catch捕获错误

摘要: <!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> </head> <body> <h1>让出错的代码出现在可控制的范围内</h1> <script> // try-catch-finally捕获异常,就是报错的东西 // 因为 阅读全文

posted @ 2017-02-20 00:06 萧皓灏博客园 阅读(793) 评论(0) 推荐(0) 编辑

表单提交的两种方式区别

摘要: 表单提交的两种方式区别 1 submit提交表单会刷新页面,页面将跳转到你提交的那个页面 <!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> </head> <body> <h1 style="color:red">submit 阅读全文

posted @ 2017-02-20 00:02 萧皓灏博客园 阅读(3766) 评论(0) 推荐(0) 编辑

2017年2月19日

jsonp跨域原理

摘要: <!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> </head> <body> <input type="button" value="点击请求"> <script src="jquery.min.js"></script> 阅读全文

posted @ 2017-02-19 23:59 萧皓灏博客园 阅读(145) 评论(0) 推荐(0) 编辑

2017年2月17日

从数据库中获取数据

摘要: $("#sCity").change(function() { // 选中的val值 var pcode = $(this).children('option:selected').val(); if(pcode !=0){ $.post("../php/1.php",{"cmd":"GetCity 阅读全文

posted @ 2017-02-17 15:57 萧皓灏博客园 阅读(200) 评论(0) 推荐(0) 编辑

省略号

摘要: <!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <style> p{ width: 100px; height: 100px; border: 1px solid #000; /* 文字不换行 */ white-space: 阅读全文

posted @ 2017-02-17 11:24 萧皓灏博客园 阅读(125) 评论(0) 推荐(0) 编辑

2017年2月16日

本地存储制作留言板,刷新记忆不删除

摘要: <!DOCTYPE html><html lang="en"> <head> <meta charset="utf-8"> <style> </style> </head> <body> <textarea name="" cols="30" rows="10" id="content"> </te 阅读全文

posted @ 2017-02-16 17:12 萧皓灏博客园 阅读(337) 评论(0) 推荐(0) 编辑

html5两种存储方式

摘要: // sessionStorage存储周期为关闭页面存储就自动清除 function send(){ var username = $("#name").val(); var pass = $("#password").val(); sessionStorage.setItem("k_usernam 阅读全文

posted @ 2017-02-16 15:53 萧皓灏博客园 阅读(187) 评论(0) 推荐(0) 编辑

原型prototype

摘要: 函数都有prototype属性 对象都有__proto__属性 原型就像是干爹,可以改变,可以多个 猫 function Cat(){ this.climb = function(){ alert("爬树"); } } 鸟 function Bird(){ this.fly = function() 阅读全文

posted @ 2017-02-16 11:29 萧皓灏博客园 阅读(106) 评论(0) 推荐(0) 编辑

2017年2月15日

闭包

摘要: 函数外部访问函数内部变量 function t() { var age = 20; return function() { // 内层函数将外层函数内部变量封锁在自己的作用域链中 console.log(age++); } } var tmp = function() { console.log(a 阅读全文

posted @ 2017-02-15 12:44 萧皓灏博客园 阅读(98) 评论(0) 推荐(0) 编辑

jquery插件库

摘要: http://www.jq22.com/daima3 行走的小人等 阅读全文

posted @ 2017-02-15 12:34 萧皓灏博客园 阅读(103) 评论(0) 推荐(0) 编辑

导航