IDE 缺少基础能力集调用库,这是一个简单的Ajax调用。
var jsonObj;
var xmlhttp = null;
function callAsync(url, callbackSuccess)
{
xmlhttp = new Ajax();
xmlhttp.open("GET", url, true);
xmlhttp.onreadystatechange=function()
{
// readyState = 4 ; "complete"
if (xmlhttp.readyState==4)
{
// status = 200 ; "ok"
if(xmlhttp.status == 200)
{
uiManager.showNotification(1000, "ok", "Done");
/*
* Remove the substr "jsonFlickrApi(" from the responseText
*/
var text = xmlhttp.responseText;
text = text.substr(14, text.length-15);
// Create JSON Oject
jsonObj = eval('(' + text + ')');
callbackSuccess(jsonObj);
}
else
{
uiManager.showNotification(1000, "warning", "Failed to get data from server");
}
}
}
xmlhttp.send(null);
}
相关文档:
<scrīpt Language="Javascrīpt">
<!--
// author:奔腾的心
// qq:7180001
function Ajax(OnError,OnState,OnDownloadEnd)
{
this.ErrorStr = null;
......
<mce:script type="text/javascript"><!--
function login(){
var postURL = "http://localhost:8080/cas/simpleLogin";
var params = {
"loginUrl":$("#loginUrl").val(),
"service":$("#service").val(),
"login":$( ......
test.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<html xmlns=
"http://www.w3.org/1999/xhtml"
>
<head>
<meta http-equiv=
"Content-Type"
conten ......
Ajax提交数据一般都是通过URL后边的参数形式来传递数据的,比如使用XMLHttpRequest.open('POST', url, true);的方式使用时,其url参数中就包含了需要提交的数据,它的形式如:http://www.mysite.com/handler.do?name='曹操'&sex='男',是把key=value形式的数据通过 &符号连接起来, ......
ASP.NET AJAX(最初代码名为“ATLAS”)框架,作为重点支持ASP.NET开发平台的开源Ajax框架在它一出世时就受到广大.NET开发人员的青睐。在本文中,我们将专注于分析ASP.NET AJAX编程中服务器与客户端通信过程中的数据存储形式的问题。具体地说,我们将探讨一个实现序列化与反序列化的服务器端对象—JavaScriptS ......