I am not clear are you looking for a design or implementation pattern/
mechanism?

It is not very difficult to send things to the server:
(http://developer.yahoo.com/common/json.html)

<html>
<head>
<title>How Many Pictures Of Madonna Do We Have?</title>
</head>
</body>
<script type="text/javascript">
function ws_results(obj) {
        alert(obj.ResultSet.totalResultsAvailable);
}
</script>
<script type="text/javascript" src="http://search.yahooapis.com/
ImageSearchService/V1/imageSearch?
appid=YahooDemo&query=Madonna&output=json&callback=ws_results"></
script>
<body></body>
</html>

In essence any dom element that has an src attribute can be used.
Example above is JSONP quasy-protocol, so it should do cross-domain
calls too ...  Although, I am sure this example will have to be tested
with the full matrix of all browsers on all platforms. As I am sure
that security anywhere in that matrix will do its best to stop you
>:o)

jQuery and logging errors to the server?
Maybe something like this:

 $(window).error(function(msg, url, line) {
           $.ajax( {
            url: "http://mikegale.com/errlog"; ,
            type: "POST",
            global: false,
            cache: false,
            data: '{ msg : \"" + msg +
                       "\", url: \"" + url + "\", line: \"" +
                      line + "\"" }'
        } ) ;
 });

Or I have missed the issue completely ?

--DBJ

On Apr 6, 11:31 pm, "Mike Gale" <[email protected]> wrote:
> Thanks Jonah.
>
> I use something like that elsewhere (an HTTP handler that logs "get strings" 
> sent to it and returns an image) but I can't see a
> clean way of making it fit into this job.
>
> A little more detail.
>
> My service has a bunch of methods that accept posted data and return various 
> things like serialized content of drop downs and xhtml
> formatted reports.
>
> It's a nice clean architecture (compiled code on the server, jQuery on the 
> browser).
>
> I would like to have the ability to log exceptions on the browser, if they 
> occur in selected places (within try catch structures).
> This would bring browser issues into line with server side code, where I'm 
> logging exceptions.  I'd really like a uniform mechanism,
> in line with my remote method calls via jQuery.  (But without any unneeded 
> complexity.)
>
> I'm abstracted away from the marshalling plumbing with jQuery, which I like.
>
> I could create an alternate XMLHTTP handler (in JavaScript) which throws the 
> callback/response away, but I'd prefer not to do that.
>
> Regards,
>
> Mike Gale
>
> CAUTION - This message may contain privileged and confidential information 
> intended only for the use of the addressee/s.
>
> If you are not the intended recipient of this message you are hereby notified 
> that any use, dissemination, distribution or
> reproduction of this message is prohibited without prior written consent.  
> Any views expressed in this message may not reflect the
> views of Decision Engineering.
>
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On 
> Behalf Of weepy
> Sent: 2009/04/7 6:26
> To: jQuery Development
> Subject: [jquery-dev] Re: Fire and Forget requests using jQuery
>
> you could create an image element with a src pointing towards your
> destination url
>
> On 6 Apr, 03:55, Mike Gale <[email protected]> wrote:
> > I have some non-critical logging messages I want to send from
> > browsers.
>
> > I don't want the browser to wait for a response, or use up an
> > available xhr channel.
>
> > The rest of the app is jQuery talking to a webservice on the server.
>
> > XMLHTTP is, as far as I know, a protocol that assumes you want a
> > response and has no mechanism for fire and forget.  I could set up
> > JavaScript code that aborted the xhr, maybe on status changed, but
> > that seems kludgy.
>
> > As far as I know, there is no native jQuery way to send a "fire and
> > forget" message.
>
> > What ways are suggested to achieve this, preferably using jQuery?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" 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/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to