$.ajaxSetup({
dataType:'text',
type:'post',
success:function(data){
不輸入type:'post'永遠是奇數和等于0
dataType:'text',
type:'post',
success:function(data){
不輸入type:'post'永遠是奇數和等于0
2017-06-28
關于這個插件的慕課網課程有這個:《jQuery插件——Validation Plugin》;
想要學的深入的小伙伴可以看看。
想要學的深入的小伙伴可以看看。
2017-06-28
<button class="btn"></button>
<div id="displayDIV"><ul></ul></div>
<script>
$(".btn").click(function () {
var arr = ['test1','test2'];
$.each(arr , function ( index , item) {
$('#displayDIV ul').append('<li>' + item + '</li>');
});
});
</script>
<div id="displayDIV"><ul></ul></div>
<script>
$(".btn").click(function () {
var arr = ['test1','test2'];
$.each(arr , function ( index , item) {
$('#displayDIV ul').append('<li>' + item + '</li>');
});
});
</script>
第一行的錯誤可以直接將其修改為 :
<html>
</html>
這樣是html5的標準.
<html>
</html>
這樣是html5的標準.
2017-06-27
代碼1:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>挑戰題</title>
</head>
<style>
form{
border-STYLE:solid;
border-color:blue;
border-top:10px solid blue;
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>挑戰題</title>
</head>
<style>
form{
border-STYLE:solid;
border-color:blue;
border-top:10px solid blue;
代碼2:
border-bottom: 10px dotted red;
border-left:10px double black;
border-right:10px dashed green;
}
</style>
<body>
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.js"></script>
<marquee direction=left><h1>學生信息登記:</h1></marquee><BR /><BR />
border-bottom: 10px dotted red;
border-left:10px double black;
border-right:10px dashed green;
}
</style>
<body>
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.js"></script>
<marquee direction=left><h1>學生信息登記:</h1></marquee><BR /><BR />
代碼3:
<input type='button' id='b3' value="點我注冊">
<form action="#" name='form1' style="display:none" id='form2'><BR /><BR />
用戶名:<input type='text' name='text' value="你瞅啥"><br />
密&nbsp;&nbsp;&nbsp;碼:<input type='password' placeholder="瞅你咋地" name='pwd'>
<input type='button' id='b3' value="點我注冊">
<form action="#" name='form1' style="display:none" id='form2'><BR /><BR />
用戶名:<input type='text' name='text' value="你瞅啥"><br />
密&nbsp;&nbsp;&nbsp;碼:<input type='password' placeholder="瞅你咋地" name='pwd'>
代碼4:
<hr />
你真的要填的:<input type='text' name='t1' id='aha'><br />
<input type='button' value="保存" id='b1'>
<input type='button' value='顯示' id='b2'><BR /><BR />
</form>
<script type="text/javascript">
$("#b3").click(function() {
$("#form2").slideToggle(2000)
});
</script>
<hr />
你真的要填的:<input type='text' name='t1' id='aha'><br />
<input type='button' value="保存" id='b1'>
<input type='button' value='顯示' id='b2'><BR /><BR />
</form>
<script type="text/javascript">
$("#b3").click(function() {
$("#form2").slideToggle(2000)
});
</script>
代碼5:
<br /></br />
<!--以下是Ajax代碼-->
<ul id='u1'></ul> <!--在這里顯示-->
<script>
var text = $('#aha');
//定義一個json對象,用于保存學生的相關資料
var jsona = [];
$('#b1').on('click', function () {
jsona.push({
name : text.val()
});
text.val('');
});
<br /></br />
<!--以下是Ajax代碼-->
<ul id='u1'></ul> <!--在這里顯示-->
<script>
var text = $('#aha');
//定義一個json對象,用于保存學生的相關資料
var jsona = [];
$('#b1').on('click', function () {
jsona.push({
name : text.val()
});
text.val('');
});
代碼6:
$('#b2').on('click',function () {
$.each(jsona,function (i) {
$('ul').append('<li>'+jsona[i].name+'</li>');
});
});
//each相當于一個for循環的迭代器 他遍歷指定的DOM元素
//第一個參數是遍歷的對象,第二個是回調函數
//索引從0開始
//append添加內容
</script>
</body>
</html>
$('#b2').on('click',function () {
$.each(jsona,function (i) {
$('ul').append('<li>'+jsona[i].name+'</li>');
});
});
//each相當于一個for循環的迭代器 他遍歷指定的DOM元素
//第一個參數是遍歷的對象,第二個是回調函數
//索引從0開始
//append添加內容
</script>
</body>
</html>