jQuery对ajax的支持

 时间:2026-02-14 00:15:33

1、<%@ page language="java" contentType="text/html; charset=UTF-8"    pageEncoding="UTF-8"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

jQuery对ajax的支持

2、<script type="text/javascript"> $(function(){  $('a[class=s1]').click(function(){   var flight = $(this).parent().siblings().eq(0).text();   $(this).next().load('order.do',{'flight':flight});  }); })

jQuery对ajax的支持

3、  <table cellpadding='0' cellspacing='0' width='80%' border='1px'>  <thead>   <tr>    <td>航班号</td>    <td>机型</td>    <td>票价</td>   </tr>  </thead>  <tbody>   <tr>   

jQuery对ajax的支持

4、 <td>CA747</td>    <td><a href="#">波音客机</a></td>    <td>    <a href="javaScript:;" class='s1'>查看所有票价</a>    <div></div>    </td>   </tr>   <tr>    <td>MU193</td>    <td><a href="#">空客客机</a></td>    <td>    <a href="javaScript:;" class='s1'>查看所有票价</a>    <div></div>    </td>   </tr>  </tbody> </table>

jQuery对ajax的支持

5、public class ActionServlet extends HttpServlet{ @Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {  //post请求,解决乱码  request.setCharacterEncoding("utf-8");  response.setContentType("text/html;charset=utf-8");  //获取请求地址  PrintWriter out=response.getWriter();  String path=request.getRequestURI();  

jQuery对ajax的支持

6、String action=path.substring(path.lastIndexOf("/"),path.lastIndexOf("."));  if(action.equalsIgnoreCase("/order")){   String flight=request.getParameter("flight");   if(flight.equals("CA747")){    out.println("经济舱:345¥</br>头等舱:556¥");   }else{    out.println("经济舱:432¥</br>头等舱:879¥");   }  } }}

jQuery对ajax的支持

  • jQuery对事件的支持
  • jQuery - AJAX load() 方法
  • jquery ajax运用的格式及说明
  • ajax如何获取jQuery数组
  • tp怎么接收jQuery的Ajax post过来的值?
  • 热门搜索
    脖子上有个包块怎么回事 手机连不上wifi是怎么回事 冬阴功汤的做法 豆干的做法大全 蒸肉粉的做法 梭子蟹炒年糕的做法 水果酵素的做法 皖怎么读 桎梏怎么读 鸡肉做法