zoukankan      html  css  js  c++  java
  • 20151209jquery学习笔记Ajax 代码备份

    /*$(function () {
    	$("input").click(function() {
            $.ajax({
    			type:'POST',
    			url:'test.php',
    			data:{
    				url:'ycku'
    				},
    				success: function(response,status,xhr){
    					$("#box").html(response);
    					}
    			});
        });
    });
    
    
    
    $(function () {
    	$('form input[type=button]').click(function() {
            $.ajax({
    			type:'POST',
    			url:'user.php',
    			data:{
    				user:$('input[name=user]').val(),
    				email:$('input[name=email]').val()
    				},
    				success: function(response,status,xhr){
    					$("#box").html(response);
    					}
    			});
        });
    });
    */
    /*表单序列化*/
    $(function () {
    	/*$('form input[type=button]').click(function() {
            $.ajax({
    			type:'POST',
    			url:'user.php',
    			data:$("form").serialize(),
    				success: function(response,status,xhr){
    					$("#box").html(response);
    					}
    			});
    			alert($('form').serialize());//字符串形式的键值对,并且还对URL进行了编码
        });
    	$('form input[name=sex]').click(function() {
           //$('#box').html(decodeURIComponent($(this).serialize()))
    	   // $('#box').html($(this).serializeArray())
    	   //console.log($('#box').html($(this).serializeArray()))
    	   var json=$(this).serializeArray();
    	   $('#box').html(json[0].name+'='+json[0].value());
        });
    	$('form input[type=button]').click(function() {
    		//初始化重复的属性
    		$.ajaxSetup({
    				type:'POST',
    			    url:'user.php',
    			    data:$("form").serialize(),
    				});
            $.ajax({
    				success: function(response,status,xhr){
    					$("#box").html(response);
    					}
    			});
    			
    			
        });
    	*/
    	$('form input[type=button]').click(function() {
            $.ajax({
    			type:'POST',
    			url:'user.php',
    			data:$.param({
    				user:$('input[name=user]').val(),
    				email:$('input[name=email]').val()
    				}),
    				success: function(response,status,xhr){
    					$("#box").html(response);
    					}
    			});
        });
    });
    

      

  • 相关阅读:
    NSURLConnection、NSURLSession
    引用自定义的framework
    iOS开发笔记
    NSFileManager文件管理
    SandBox+NSBundle
    CoreData基础
    SQLite3
    iOS中常见的设计模式——单例模式委托模式观察者模式MVC模式
    Runtime机制之结构体及操作函数
    数据结构之链表
  • 原文地址:https://www.cnblogs.com/xiaoduc-org/p/5034049.html
Copyright © 2011-2022 走看看