Side-effect only requests

K

Kenny

I have this Ajax app and sometimes I need to communicate with the server
only for the side-effect, not expecting any HTML or JSOn data back, but
I should wait on the ACK before proceeding to kick off, say, a reload of
a datagrid which will end up accessing the side-effected server data.

eg, it could simply be a checkbox that says "comedies" and I just want
to repopulate the "movies" store on the server and then quick off a
"refresh" of the grid.

What I found when I returned nothing was I got a "no element" error from
somewhere. But if I returned any empty div whoever it was that was
complaining seemed happy, even tho I did nothing with the div.

I am guessing I am missing some way to say "I handled this already", but
all I do in cases where I /do/ stuff the response into innerHTML is
that, I do not otherwise say "I handled it".

The "no element" error seems benign, but I do not like errors of any
kind, they might not be so benign some day.

Any hints greatly appreciated.

kt
 
D

David Mark

I have this Ajax app and sometimes I need to communicate with the server
only for the side-effect, not expecting any HTML or JSOn data back, but
I should wait on the ACK before proceeding to kick off, say, a reload of
a datagrid which will end up accessing the side-effected server data.
Okay.


eg, it could simply be a checkbox that says "comedies" and I just want
to repopulate the "movies" store on the server and then quick off a
"refresh" of the grid.

What I found when I returned nothing was I got a "no element" error from
somewhere. But if I returned any empty div whoever it was that was
Somewhere?

complaining seemed happy, even tho I did nothing with the div.

I am guessing I am missing some way to say "I handled this already", but
all I do in cases where I /do/ stuff the response into innerHTML is
that, I do not otherwise say "I handled it".

The "no element" error seems benign, but I do not like errors of any
kind, they might not be so benign some day.

Doesn't sound benign to me.
Any hints greatly appreciated.

Try looking at the source. I am guessing that some of it is borrowed
(e.g. a library of some sort.)
 
K

Kenny

David said:
Somewhere?

Firebug comsole reports it, I wager FireFox is throwing it.
Doesn't sound benign to me.

FireFox does not crash, the page does not freeze, indeed the page
appears as it should. How so? A GET request from which no response was
required other than notification of completion is completing
successfully. The only problem is FireFox does not know what to do with
an empty response, but at least it shrugs it off and caries on in the
hope that the response was not needed. It was right. Hence...benign.
Try looking at the source.

Of FireFox? I doubt it is that hard to figure out for anyone who knows Ajax.

kt
 
D

David Mark

Firebug comsole reports it, I wager FireFox is throwing it.

FireFox does not throw exceptions to the error console (scripts do.)
So save your money. Firebug has nothing to do with it, unless you are
mistaking one of its warnings for an error.
FireFox does not crash, the page does not freeze, indeed the page

That's good. It is hard to imagine a script error that would crash
Firefox. A bad script could freeze it and it is good to know that
yours does not.
appears as it should. How so? A GET request from which no response was
required other than notification of completion is completing
successfully.

Why is it not a POST? GET requests are not supposed to have side
effects on the server.
The only problem is FireFox does not know what to do with
an empty response, but at least it shrugs it off and caries on in the
hope that the response was not needed. It was right. Hence...benign.

More like not an error at all (likely a Firebug warning.)
 
K

Kenny

Kenny said:
I have this Ajax app and sometimes I need to communicate with the server
only for the side-effect, not expecting any HTML or JSOn data back, but
I should wait on the ACK before proceeding to kick off, say, a reload of
a datagrid which will end up accessing the side-effected server data.

eg, it could simply be a checkbox that says "comedies" and I just want
to repopulate the "movies" store on the server and then quick off a
"refresh" of the grid.

What I found when I returned nothing was I got a "no element" error from
somewhere. But if I returned any empty div whoever it was that was
complaining seemed happy, even tho I did nothing with the div.

I am guessing I am missing some way to say "I handled this already", but
all I do in cases where I /do/ stuff the response into innerHTML is
that, I do not otherwise say "I handled it".

The "no element" error seems benign, but I do not like errors of any
kind, they might not be so benign some day.

Any hints greatly appreciated.

kt

I maanged to make (whoever...firebug? ffox?) happy by changing
mime/types -- text/javascript seems fine with an empty string or "42".

kt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,135
Messages
2,570,783
Members
47,339
Latest member
flaviu2

Latest Threads

Top