ajax ¶ÁÈ¡ .csv Îļþ
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>JavaScript Sample</title>
<link rel="stylesheet" type="text/css" href="main.css" media="all">
<script type="text/javascript" src="prototype.js"></script>
<script type="text/javascript" src="main.js"></script>
</head>
<body>
<h1>CSVÐÎʽ¤Î¥Çー¥¿¤ò読¤ß込¤ß±íʾ¤¹¤ë</h1>
<div id="tableData">¥Çー¥¿¤ò読¤ß込¤ßÖÐ....</div>
</body>
</html>
window.onload = function(){
var msec = (new Date()).getTime();
new Ajax.Request("data.csv", {
method: "get",
parameters: "cache="+msec,
onSuccess:function(httpObj){
var text = httpObj.responseText;
var LF = String.fromCharCode(10);
var tabText = text.split(LF);
var tbl = "<table border='1'>";
for (var i=0; i<tabText.length; i++){
var cText = tabText[i].split(",");
tbl += "<tr>";
for (var j=0; j<cText.length; j++){
tbl += "<td>"+cText[j]+"</td>";
}
tbl +="</tr>";
}
tbl += "</table>";
$("tableData").innerHTML = tbl;
},
onFailure:function(httpObj){
$("tableData").innerHTML = "¥¨¥éー¤Ç読¤ß込¤á¤Þ¤»¤ó¤Ç¤·¤¿";
}
});
}
Ïà¹ØÎĵµ£º
½ñÌì°ïͬʽâ¾öÁËjsÒì²½µ÷ÓÃʱ³öÏÖÁËÖÐÎÄÂÒÂëµÄÎÊÌ⣬¾ßÌå½â¾ö°ì·¨ÈçÏ£º
1£©Ê×ÏÈÈ·ÈÏjsÊÇ·ñûÓжԺǫ́´«Êä¹ýÀ´µÄÖÐÎĽøÐнâÂë¡£
°´ÕÕÍøÂçÉÏдµÄ·½·¨Í¨¹ýjs¶ÔresponseµÄ¶ÁÈ¡³öÀ´Êý¾Ý½øÐжà´Î²âÊÔ£¬·¢ÏÖÈÔÈ»²»Äܽâ¾ö£¬Ï¸Ïë²»Ò»¶¨ÊÇ´Ë´¦ÎÊÌâ¡£¸Ä»»ÆäËû°ì·¨½â¾ö¡£
2£©Èç¹û½âÂë½â¾ö²»ÁË£¬ÔÙ¿´ÊÇ·ñÊÇÒòΪÍø ......
IDE£ºVisual Web Developer 2008 Express Edition
Êý¾Ý¿â£ºAccess 2007
µ½http://www.asp.net/ajax/downloads/ÏÂÔØAJAX Control Toolkit£¬½«AjaxControlToolkit.dll¿½±´µ½ÏîÄ¿µÄbinĿ¼Ï£¬ÔÚ¹¤¾ßÀ¸ÖÐÒýÈë¡£
WebServiceµÄ´úÂ룺£¨aaa.asmx£©
Public Function GetCompletionList(ByVal prefixText As String, ByVal coun ......
ÔÚ¿´ÎÄÕÂÇ°£¬ÏÈÖ¸¶¨Ò»¸öͨÓõıäÁ¿xhr£¬xhr´úÂëajax¶ÔÏó¡£
²âÊÔä¯ÀÀÆ÷£ºieΪie6£¬firefoxΪ2£¬ÆäËûµÄδ²âÊÔ¡£Í³³Æie6Ϊie£¬firefox2Ϊff¡£
»ù±¾µÄ
1£¬×î¾µäµÄ¾ÍÊÇieϵĻº´æÎÊÌâÁË¡£
Èç¹ûʹÓõÄÊÇget£¬ÄÇôÔÚieϳöÏÖ»º´æÎÊÌâ¡£µ¼Ö´úÂëÖ»Ö´ÐÐÒ»´Î¡£½â¾ö°ì·¨¾ÍÊǼÓʱ¼ä´Á»òÕßËæ»úÊý£¬Ê¹url±äΪΨһ£¬ÕâÑù¾Í²»»á³öÏÖ ......
Microsoft AJAX Library
Microsoft AJAX Library[ÏÂÔØ]ÊÇ΢ÈíΪASP.NETµÄAJAX¹¦ÄÜÌṩµÄ¿Í»§¶ËJavascriptÀ©Õ¹Àà¿â¡£ËäÈ»ÊÇΪASP.NET±àдµÄ£¬µ«Í¬ÑùÊÊÓÃÓÚÆäËûÓïÑÔ¡£
ÓëÈç½ñ±»¹ã·ºÊ¹ÓõÄprototype¡¢jqueryµÈAJAXÀà¿âÏà±È£¬Microsoft AJAX LibraryLÁé»îÐÔ¿ÉÄܲ»×㣬¶øÇÒҲûÓÐÆäËûÀà¿â"Çá"£¬Èçprototy ......
var xmlHttp;
var flag = false;
function createXMLHttpRequest()
{
if(window.ActiveXObject)
{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
else if(window.XMLHttpRequest)
{
xmlHttp=new XMLHttpRequest();
}
}
fu ......