栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

jQuery在HTTP URL上获取请求

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

jQuery在HTTP URL上获取请求

我提供了一个示例方案来帮助您入门:

<!-- Include this jQuery library in your HTML somewhere: --><script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.0/jquery.min.js"></script

最好将其包含在外部JS文件中:

//Listen when a button, with a class of "myButton", is clicked//You can use any jQuery/Javascript event that you'd like to trigger the call$('.myButton').click(function() {//Send the AJAX call to the server  $.ajax({  //The URL to process the request    'url' : 'page.php',  //The type of request, also known as the "method" in HTML forms  //Can be 'GET' or 'POST'    'type' : 'GET',  //Any post-data/get-data parameters  //This is optional    'data' : {      'paramater1' : 'value',      'parameter2' : 'another value'    },  //The response from the server    'success' : function(data) {    //You can use any jQuery/Javascript here!!!      if (data == "success") {        alert('request sent!');      }    }  });});


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/404101.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号