hi friends,
I am very new to igoogle development, I am trying to make a igoogle
gadget using ajax.
I wrote the code like this for call the server
<script type="text/javascript">
var sessionId = null;
function login()
{
var url="xxx";
alert(url);
var params = {};
gadgets.io.makeRequest(url, response, params);
}
function response(obj){
var jsonText = obj.text;
jsonText = eval('(' + jsonText + ')');
sessionId = jsonText.platform.login.sessionId;
alert("Session Id : "+sessionId);
getOrderList();
}
function getOrderList()
{
alert("Your in correct path");
var execURL = "yyy";
var params = {};
var postdata =
{platform:{execClass:
{clazz:"clazz",method:"process",AppNo:"0000000025",emailaddress:"xxx.com",pwd:"11111",Query:"SELECT
SD_DOC, ITM_NUMBER,REQ_QTY, MATERIAL, QTY,NET_PRICE FROM WHERE
CUSTOMER_NUMBER = 0000000025 and SALES_ORGANIZATION = APL"}}}));
postdata = gadgets.io.encodeValues(postdata);
params[gadgets.io.RequestParameters.METHOD] =
gadgets.io.MethodType.POST;
params[gadgets.io.RequestParameters.CONTENT_TYPE] =
gadgets.io.ContentType.JSON;
params[gadgets.io.RequestParameters.HEADERS] =
{"Cookie":"JSESSIONID='+sessionId+'", "Content-Type": "application/
json"};
params[gadgets.io.RequestParameters.POST_DATA]= postdata;
gadgets.io.makeRequest(execURL,orderListResp,params);
}
function orderListResp(obj)
{
var respp = obj.text;
alert(respp);
}
</script>
<input type="button" id="but1" onclick="login()" value="Click Me" />
Here I am using JSON as a content type.
after I call the second url, I am getting 200 Response code but I am
not getting black response.
please help me ,
thanks very much
--
You received this message because you are subscribed to the Google Groups
"iGoogle Developer Forum" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/Google-Gadgets-API?hl=en.