Side-effect only requests | | |
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 | | | | re: Side-effect only requests
On Nov 19, 7:37*pm, Kenny <kentil...@gmail.comwrote: Quote:
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. Quote:
>
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? Quote:
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. Quote:
>
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.) | | | | re: Side-effect only requests
David Mark wrote: Quote:
On Nov 19, 7:37 pm, Kenny <kentil...@gmail.comwrote:
> Quote:
>>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.
>
> Quote:
>>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?
Firebug comsole reports it, I wager FireFox is throwing it. Quote:
>
> Quote:
>>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.
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. Quote:
>
> Quote:
>>Any hints greatly appreciated.
>
>
Try looking at the source.
Of FireFox? I doubt it is that hard to figure out for anyone who knows Ajax.
kt | | | | re: Side-effect only requests
On Nov 20, 12:10*am, Kenny <kentil...@gmail.comwrote: Quote:
David Mark wrote: Quote:
On Nov 19, 7:37 pm, Kenny <kentil...@gmail.comwrote:
> Quote: Quote:
>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.
> > Quote: Quote:
>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.
> Quote: Quote:
>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
> >
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. Quote:
>
> Quote: Quote:
>complaining seemed happy, even tho I did nothing with the div.
> Quote: Quote:
>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".
> Quote: Quote:
>The "no element" error seems benign, but I do not like errors of any
>kind, they might not be so benign some day.
> Quote:
Doesn't sound benign to me.
>
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. Quote:
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. Quote:
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.) | | | | re: Side-effect only requests
Kenny wrote: Quote:
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 |  | Similar JavaScript / Ajax / DHTML bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,510 network members.
|