Side-effect only requests

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kenny

    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
  • David Mark

    #2
    Re: Side-effect only requests

    On Nov 19, 7:37 pm, Kenny <kentil...@gmai l.comwrote:
    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.)

    Comment

    • Kenny

      #3
      Re: Side-effect only requests

      David Mark wrote:
      On Nov 19, 7:37 pm, Kenny <kentil...@gmai l.comwrote:
      >
      >>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?
      Firebug comsole reports it, I wager FireFox is throwing it.
      >
      >
      >>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.
      >
      >
      >>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

      Comment

      • David Mark

        #4
        Re: Side-effect only requests

        On Nov 20, 12:10 am, Kenny <kentil...@gmai l.comwrote:
        David Mark wrote:
        On Nov 19, 7:37 pm, Kenny <kentil...@gmai l.comwrote:
        >
        >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?
        >
        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.
        >
        >
        >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
        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.)

        Comment

        • Kenny

          #5
          Re: Side-effect only requests

          Kenny wrote:
          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...fire bug? ffox?) happy by changing
          mime/types -- text/javascript seems fine with an empty string or "42".

          kt

          Comment

          Working...