ajax´«Öµ¸øCGI,µ«CGIµÃ²»µ½Êý¾Ý
ÔÚfunction lb(i)ÖмÓÈëalert(x_url)Äܵõ½ÕýÈ·µÄÖµ"bbs_get_grouplist?gn=1&lb=1"
µ«ajax´«»ØÀ´µÄֵʼÖÕÊÇ"aaaaaaaaaaa",²»ÖªµÀÊÇʲôÔÒò¡£
main(){
printf("%s","Content-type:text/html;charset=UTF-8;\n\n");
if(getenv("CONTENT-LENGTH")){
int n=atoi(getenv("CONTENT_LENGTH"));
printf("%d",n);
}
else{
printf("%s","aaaaaaaaaaa");
}
}
function lb(i){
var x_lb=document.getElementById("bbs_group1").value;
var x_url="bbs_get_grouplist?gn="+i+"&lb="+x_lb;
if(!req)requestCreate();
if(req){
req.open("GET" , x_url , true);
req.onreadystatechange=function(){if(req.readyState==4 && req.status==200)alert(req.responseText);}
req.send(null);
}
}
POSTʱºòÔÙ¼ì²éCONTENT_LENGTH
GET·½·¨Ö±½Ó¶ÁÈ¡
QUERY_STRING¼´¿É
¸øÄãÒ»¸öcдµÄcgi demo,¹ØÓÚ»·¾³±äÁ¿µÄ,Ó¦¸Ã¶ÔÒ»ÓÐÓÃ.
C/C++ code:
// cgi-demo.c: Simple CGI demo program.
// Vers. 2.00 - 04.April 2007
// k.d.walter@t-online.de
// Includes
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main (int argc, char *argv[])
{
char *pEnvPtr;
printf ("
Ïà¹ØÎÊ´ð£º
²é¿´Ô´Îļþʱ³öÀ´µÄ
<script type="text/javascript">
// <![CDATA[
Sys.Application.initialize();
Sys.Application.add_init(function() {
$create(Sys.UI._Upd ......
¾¹ýÒ»¸öÐÇÆÚµÄ²»¶ÏŬÁ¦£¬ÎҵĻùÓÚAjax+SSH(Óеãµãɱ¼¦ÓÃÅ£µ¶£¬ºÇºÇ)µÄ¸öÈ˲©¿ÍÖÕÓÚ¿ÉÒÔÕýʽÉÏÏßÁË¡£
ÏÖÔÚÉ¢·Ö½ÓÊܸ÷λ´óÏÀµÄ±ÉÊÓ¡£
ÍøÖ· www.bleehome.cn BLEE HOME
(±¾À´Ïë¶àÉ¢µã£¬µ«ËµÎÒÖ»ÄÜÉ ......
Ö÷Ò³ÃæDefaultÉè¼Æ´úÂëÈçÏ£º
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Regis ......
Ò³ÃæÍ·²¿ÒýµÃÑùʽ±í
<link style="../css/01_box_fixed.css">
<script src='../dwr/interface/user_login.js'> </script>
<script src='../dwr/engine. ......
ÔÚ¼ÒÑо¿ajax£¬¿´Á˱ðÈ˵ÄÒ»¸öÍøÉϹºÎïÉ̳ÇÏîÄ¿µÄÔ´´úÂ룬×Ô¼ºÒ²À´·Â±ðÈ˵Ķ«Î÷Á·Ï°Á·Ï°£¬Ã»Ïë³öÎÊÌâÁË£¡Ò»ÏµÄÕâЩ´úÂëÊÇÎÒ·ÂÕÕ±ðÈËдµÄ¡£ÎÒÊÇÏëÈÃ×¢²áµÄÈËÌîдÓû§Ãû£¬¹â±êÀ뿪Óû§ÃûºóÃæµÄÌîд¿Õ°×´¦ºóÁ¢¿ÌÀûÓÃaj ......