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+”
Ïà¹ØÎĵµ£º
ÎÒÃǶ¼ÖªµÀ£¬ajaxÄÜÌá¸ßÒ³ÃæÔØÈëµÄËٶȵÄÖ÷ÒªÔÒòÊÇͨ¹ýajax¼õÉÙÁËÖØ¸´Êý¾ÝµÄÔØÈë£¬ÕæÕý×öµ½°´Ðè»ñÈ¡£¬¼ÈÈ»Èç´Ë£¬ÎÒÃÇÔÚдajax³ÌÐòµÄʱºò²»·ÁËÍ·ðË͵½Î÷£¬ÔÚ¿Í»§¶ËÔÙ×öÒ»´Î»º´æ,½øÒ»²½Ìá¸ßÊý¾ÝÔØÈëËÙ¶È¡£ÄǾÍÊÇÔÚÔØÈëÊý¾ÝµÄͬʱ½«Êý¾Ý»º´æÔÚä¯ÀÀÆ÷ÄÚ´æÖУ¬Ò»µ©Êý¾Ý±»ÔØÈë£¬Ö»ÒªÒ³ÃæÎ´Ë¢Ð£¬¸ÃÊý¾Ý¾ÍÓÀÔ¶µÄ»º´æÔÚÄÚ´æÖУ¬µ±Ó ......
Ò»ÖÜǰ£¬leaderÈÃÎÒдһ¸öÀàËÆ°Ù¶ÈµÄ×Ô¶¯Íê³É¹¦ÄÜ£¬ºÇºÇ£¬ÒòΪ¶Ôajax¼¼ÊõÕÆÎյIJ»ºÃ£¬ËùÒÔ¿àÄÕÁ˺ܾÃûÓÐд³öÀ´
¾¹ýÒ»ÖܵÄѧϰ£¬ÖÕÓÚд³öÁËÒ»¸öajax³ÌÐò£¬ÒÔºóµÄ¹¤×÷¾ÍºÃ×ö¶àÀ²
index.jsp
<html>
<head>
<style >
#child{
color: #333;
width:200px;
&nbs ......
Private static readonly object ReflectionLock = new object();
Lock (ReflectionLock)
{
Type scriptManagerType =
Type.GetType(
"System.Web.UI.ScriptManager, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35",
false);
......
ajaxÖÐXMLHttpRequest²ÎÊýÏê½â ÊÕ²Ø
XJAX ,²¢²»ÊÇÒ»ÖÖÐÂ[url=javascript:;]¼¼Êõ[/url]µÄµ®Éú.Ëüʵ¼ÊÉÏ´ú±íµÄÊǼ¸Ïî¼¼Êõ°´Ò»¶¨µÄ·½Ê½×éºÏÔÚÒ»ÔÚͬ¹²µÄÐ×÷Öз¢»Ó¸÷×ÔµÄ×÷ÓÃ.
Ëü°üÀ¨£º
ʹÓÃXHTMLºÍ[url=javascript:;]CSS[/url]±ê×¼»¯³ÊÏÖ£»
ʹÓÃDOMʵÏÖ¶¯Ì¬ÏÔʾºÍ½»»¥£»
ʹÓÃ[url=javascript:;]XML[/url]ºÍXSLT½øÐÐÊý ......
°Ñ×Ô¼ºÐ´µÄjqueryдÏÂÀ´
±ÈÈçÏÖÔÚÓÐÒ»¸ö½çÃæ£¬·Ö×óÓÒÁ½²à£¬µ±µã»÷×ó²àµÄ±êÇ©£¬È»ºóÔÚÓÒ²à¿òÏÔʾ£¬ÊµÏÖÎÞˢм¼Êõ£¬ÕâÊÇ×î¼òµ¥µÄajaxÓ¦Óá¡
function touser() {
$.ajax({
url: "UserTable.aspx?timeStamp=" + new Date().getTime(),
success: function(msg) {
$("#ma ......