Login Register

dojo.xhrPost Object does not support this property or method

I am having some trouble trying to figure out what to send back the the client. My JSON post is supposed to update a table in Oracle which is working fine, but I am getting "Object does not support this property or method" after it updates.

Using IE
Apache2 posting to perl page.
Dojo 1.2

Here is the line of code from the dojo.js that it is complaining about
var ret=_d._contentHandlers[dfd.ioArgs.handleAs](dfd.ioArgs.xhr)

here is my dojo code for posting

Should I be sending the 200 ok back in json format or .......?

postScheduleItem = function( item, event ) {
//var poststr = '{ ';
var poststr= {};
for (x in item){

poststr = poststr + x + ': ' + '\'' + item[x] + '\'' + ', ';
console.debug('ATTR:' + x + 'Value:' + item[x] );
}
poststr = poststr.substring(0, poststr.length-2);
//poststr += ' }';
//dojo.json.serialize(myObjects);
alert(poststr);
var newEntry = { NE: item.NE, LOGIN_ID: item.LOGIN_ID, ROWID: item.ROWID }
var postdata = {
url: "http://myserver/getData?type=" + rptpage + "&event=" + event,
handleAs: 'text/html',
content: newEntry,
load: function(response){
if( !response.status)
alert( "Response: \n Status: " + response.status + "\n" + response.message );
else
if( event == "newitem" ) {
addMessage( "New Schedule for device " + item.name + " created. Schedule-ID: " + response.message );
item.id = response.message;
}
},

error: function(data){
alert("Error saving: " + data.message );
},

timeout: 1000,
sync: true
};

dojo.xhrPost(postdata); //Servlet get argement with doPost
}

I think it is the

I think it is the handleAs:"text/html" -- it is now just handleAs:"text" (which is the default, and used if omitted) -- but when the load: happens, it filters the response data through a _contenthandler with the same value as "handleAs" (eg: dojo._contentHandlers["text"](data) ) so it may just be dying trying to find a function.

Hope this helps.

Regards,
Peter Higgins

That did it. Thanks

That did it. Thanks