Live search using BSP (BSPÖÐAJAXʵÏÖ)
³õѧBSP, Ò»Ö±ÔÚÏëÈçºÎʵÏÖAJAXЧ¹û, Æðµ½ÎÞÒâ¿´µ½ÕâƪÍøÎÄ, ²ÅÓÐÒ»ÖÖ»óÈ»¿ªÀʵĸоõ, ¿÷ÎÒ»¹¹ýASP/ASP.net , ÕæÊÇ×öÁ˼¸ÄêABAP×öɵÁË,ºÇºÇ
ÆäʵBSPºÍASPºÜÏó, ¿ÉÒÔ²ÉÓÃASPµÄ·½·¨À´ÊµÏÖAJAXÓ¦ÓÃ, ÎÞ·ÇÊǵ÷ÓÃxmlHttpRequest¶ÔÏó¶ø¼º.
ÔÎĵØÖ·: http://scnblogs.techweb.com.cn/leonard/archives/38.html, תÌùÈçÏÂ:
ÄãÒ»¶¨¾³£Ê¹ÓÃgoogle»ò°Ù¶È¡£µ±ÄãÊäÈëÒª²éѯµÄ´ÊÌõµÄʱºò£¬ÔÚÊäÈë¿òµÄϱ߻á×Ô¶¯Ìáʾ¿ÉÄܵÄÑ¡ÏËæ×ÅÄãÊäÈëÖµµÄ±ä»¯¶ø±ä»¯¡£Õâ¾ÍÊÇËùν”Search-as-you-type”¡£
Google “Search-as-you-type” ÓÐһЩÑÝʾcode¿ÉÏÂÔØ£¬ÒªÔËÐеĻ°ÔÙÏÂÔØÒ»¸ö³¬ÇáÁ¿¼¶µÄHttp·þÎñÆ÷xampp¡£
http://code.google.com/p/search-as-you-type/
ÉÏÃæµÄcodeÊÇÓÃPHPдµÄ£¬ÒªÖªµÀËüµÄÔÀí£¬¿ÉÒԲο¼ÏÂÃæÕâƪÎÄÕ£º
PHP Ajax live search
http://www.w3schools.com/php/php_ajax_livesearch.asp
ÄÇôÕâÖÖ¼¼ÊõÓÃSAPµÄ¼¼ÊõÊÇ·ñ¿ÉÒÔʵÏÖÄØ£¿»Ø´ðÊǿ϶¨µÄ¡£Óüòµ¥µÄBSP+Javascript±à³Ì¾Í¿ÉÒÔʵÏÖ¡£
Ê×ÏÈ´´½¨Ò»¸öBSP Application: zlive_search
ÔÙ´´½¨Á½¸öPages with Flow Logic:
1. search.htm
2. livesearch.htm
Search.htm - search page with an input text box
<%@page language=”abap”%>
<%@extension name=”htmlb” prefix=”htmlb”%>
<html>
<head>
<script type=”text/javascript”>
var xmlhttp;
function showResult(str)
{
if (str.length==0)
{
document.getElementById(”livesearch”).innerHTML=””;
document.getElementById(”livesearch”).style.border=”0px”;
return;
}
xmlhttp=GetXmlHttpObject()
if (xmlhttp==null)
{
alert (”Your browser does not support XML HTTP Request”);
return;
}
var url=”livesearch.htm”;
url=url+”?q=”+str;
url=url+”
Ïà¹ØÎĵµ£º
Ò»ÖÜÇ°£¬leaderÈÃÎÒдһ¸öÀàËưٶȵÄ×Ô¶¯Íê³É¹¦ÄÜ£¬ºÇºÇ£¬ÒòΪ¶Ôajax¼¼ÊõÕÆÎյIJ»ºÃ£¬ËùÒÔ¿àÄÕÁ˺ܾÃûÓÐд³öÀ´
¾¹ýÒ»ÖܵÄѧϰ£¬ÖÕÓÚд³öÁËÒ»¸öajax³ÌÐò£¬ÒÔºóµÄ¹¤×÷¾ÍºÃ×ö¶àÀ²
index.jsp
<html>
<head>
<style >
#child{
color: #333;
width:200px;
&nbs ......
×î½üÔÚÓÃAjax×öµÇ¼´°¿Ú£¬µ«ÊÇlogoutµÄʱºòÐèÒª¶Ôsession½øÐд¦Àí¡£ÓõÄÊÇsession.removeAttribute()º¯Êý½øÐÐlogout¡£µ«ÊÇ£¬ÊÂʵ֤Ã÷£¬ÔÚlogoutÒÔºó£¬ÔٴεǼµÄʱºò£¬²¢²»Äܵǽ³É¹¦£¬Ñ¹¸ù²»»á½øÈëactionÖ´ÐÐÏàÓ¦µÄ·½·¨£¨hqlÓï¾äҲûÓÐÖ´ÐУ©¡£
Ϊ´Ë£¬¾Ý˵ÓÐÁ½ÖÖ·½·¨½ ......
ÔÚ×öajax¼ÓÔØÒ³ÃæʱÓöµ½ÁËÒ»¸öÎÊÌ⣬дÔÚ±»¼ÓÔØÒ³ÃæheadÀïµÄstyle±ê¼ÇËƺõ×ÜÊÇÎÞЧ¡£Òâʶµ½ÏÖÔÚÊÇÔÚieÖУ¬ÓÚÊÇÎÒתÏòffÖе÷ÊÔ£¬½á¹ûÔÚffÖÐÊÇÓÐЧµÄ¡£ÕâÕæÊÇÆæ¹ÖÁË£¬ÄѵÀffºÍieÔÚ¼ÓÔØÒ³ÃæʱÕæ»áÓв»Í¬µÄ´¦Àí·½Ê½Âð£¿ÕâÖÖ²»Í¬ÔÚʲôµØ·½ÄØ£¿
ÎÒÉè·¨²é¿´ffºÍieÖмÓÔص½ä¯ÀÀÆ÷µÄÔ´´úÂ룬£¨ÓõÄalert(document.getElementById(' ......
AJAX¼¼ÊõÓ¦ÓÃÏê½â ÊÕ²Ø
AJAXÊÇAsynchronous JavaScript and XML µÄËõд¡£Ëü²¢²»ÊÇÒ»ÃÅеÄÓïÑÔ»ò¼¼Êõ£¬Ëüʵ¼ÊÉÏÊǼ¸Ïî¼¼Êõ°´Ò»¶¨µÄ·½Ê½×éºÏÔÚÒ»ÔÚͬ¹²µÄÐ×÷Öз¢»Ó¸÷×ÔµÄ×÷Óã¬Ëü°üÀ¨:ʹÓÃXHTMLºÍCSS±ê×¼»¯³ÊÏÖ;ʹÓÃDOMʵÏÖ¶¯Ì¬ÏÔʾºÍ½»»¥;ʹÓÃXMLºÍXSLT½øÐÐÊý¾Ý½»»»Óë´¦Àí;ʹÓÃXMLHttpRequest½øÐÐÒì²½Êý¾Ý¶ÁÈ¡;×î ......