Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ajax jsp¶þ¼¶Áª¶¯ÏÂÀ­¿ò select¿ò


//==================>¡¾index.jsp¡¿===============================
<%@page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<% String path=request.getContextPath();   %>
<%@page import="com.sinoest.dfrf.orm.pojo.Mainmenu"%>
<%@page import="com.sinoest.dfrf.orm.pojo.Menucontent"%>
<% List<Mainmenu> mmlist = (List<Mainmenu>)request.getAttribute("mmList");
if(mmlist==null){   mmlist=new ArrayList(); } %>
<% List<Menucontent> mclist = (List<Menucontent>)request.getAttribute("mcList");
if(mclist==null){   mclist=new ArrayList(); } %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>¶þ¼¶²Ëµ¥</title>
<script type="text/javascript">
     var req;
     window.onload=function()
     {//Ò³Ãæ¼ÓÔØÊ±µÄº¯Êý
     }
     function Change_Select(){//µ±µÚÒ»¸öÏÂÀ­¿òµÄÑ¡Ïî·¢Éú¸Ä±äʱµ÷Óøú¯Êý
       var province = document.getElementById('province').value;
       var url = "select?id="+ escape(province);
       if(window.XMLHttpRequest){
         req = new XMLHttpRequest();
       }else if(window.ActiveXObject){
         req = new ActiveXObject("Microsoft.XMLHTTP");
       }
       if(req){
         req.open("GET",url,true);
         //Ö¸¶¨»Øµ÷º¯ÊýΪcallback
         req.onreadystatechange = callback;
         req.send(null);
  


Ïà¹ØÎĵµ£º

µÚËÄÕ Ajax·þÎñÆ÷À©Õ¹ÆÊÎö

µÚËÄÕ  Ajax·þÎñÆ÷À©Õ¹ÆÊÎö
Ajax·þÎñÆ÷À©Õ¹£ºASP.NET Ajax¿ò¼ÜµÄ·þÎñÆ÷¶Ë¡£
4.1ASP.NET ¿ª·¢ÈËÔ±µÄAjax
Ϊ·þÎñÆ÷¶Ë¿ª·¢ÌṩAjaxÖ§³Ö¡£°üÀ¨Ò»×éеķþÎñÆ÷¿Ø¼þºÍ·þÎñ£¬ÓÃÀ´ÃþÄâ¿Í»§¶ËAjaxÐÐΪ¡£
 
4.2¸Ä½øÔ­ÓÐASP.NETÍøÕ¾
(1)¸ÄÉÆÍøÂçÑÓ³Ù£º¾¡×î´ó¿ÉÄܼõÉÙä¯ÀÀÆ÷ºÍ·þÎñÆ÷Ö®¼ä´«µÝµÄÊý¾ÝÁ¿¡£
(2)Ïû³ýȫҳà ......

һƪ²»´íµÄ¹ØÓÚjsp sessionµÄ½éÉÜ£¨×ª£©

 
ÕªÒª£ºËäÈ»session»úÖÆÔÚwebÓ¦ÓóÌÐòÖб»²ÉÓÃÒѾ­ºÜ³¤Ê±¼äÁË£¬µ«ÊÇÈÔÈ»ÓкܶàÈ˲»Çå³þsession»úÖÆµÄ±¾ÖÊ£¬ÒÔÖÁ²»ÄÜÕýÈ·µÄÓ¦ÓÃÕâÒ»¼¼Êõ¡£±¾ÎĽ«ÏêϸÌÖÂÛsessionµÄ¹¤×÷»úÖÆ²¢ÇÒ¶ÔÔÚJava web applicationÖÐÓ¦ÓÃsession»úÖÆÊ±³£¼ûµÄÎÊÌâ×÷³ö½â´ð¡£
Ŀ¼£º
Ò»¡¢ÊõÓïsession
¶þ¡¢HTTPЭÒéÓë״̬±£³Ö
Èý¡¢Àí½âcookie» ......

jquery ajaxÖÐÎÄ´¦Àí·½·¨

jqueryÖÐÓÃajax(Ã²ËÆ±àÂëĬÈÏΪutf-8)Èç¹ûÓÐÖÐÎĵϰ »á³öÏÖÂÒÂë ÏÂÃæµÄ½â¾ö°ì·¨Ö®Ò»£º
ÒÔÏÂÊÇjsÖеĴúÂë 
classname=encodeURI($('#classname').val());
classdescription=encodeURI($('#classdescription').val());
actionArr={classname:classname,classdescription:classdescription};
$.post("product_class ......

ajax Áª¶¯

function selectTradezone(){
    var copyTradezone = document.forms[0].copyTradezone;
    new BaseTool().ajax("getTradezoneByCity",callback,[document.forms[0].city.value,document.forms[0].brand.value]);
   
    function callba ......

JSP´¦ÀísessionÓëcookieÑо¿Èý

¶¨ÒåÒ»¸ösession±äÁ¿
session.setAttribute("user_name","joan");
¶Áȡһ¸ösessionµÄÖµ:
String your_name=session.getAttribute("user_name");
ÅжÏÒ»¸ösessionÊÇ·ñ´æÔÚÓ¦ÓÃ:
if((String)session.getAttribute("user_id")==null)
{
out.print("yes");
}
else
{
out.print("no");
}
дÈëÒ»¸öcook ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ