Re: "AJAX" - sending but don't need response?



Randy Webb wrote:
Jonas Raoni said the following on 3/6/2006 5:19 PM:

Randy Webb wrote:

Tony said the following on 3/6/2006 3:33 PM:
This old trick always work,

Remember that! :)

but it's just a trick, I think the XHR is the right way of doing it.

Then you think wrong :)

It just depends of your point of view, the right solution is the solution that fills the requirements.

Besides the fact that the query string has a size limit too, so this trick isn't the best way to send data either.

Yes, the querystring has a size limit. But using the img.src "trick" as you call it is more reliable and can be used and get around the URL size limit. Create 10 images and now you have 10 times the data going to the server - as long as the server knows how to accept/handle it.

This sounds bizarre to me, a workaround over another workaround. If there's a way to avoid making such strange things, why not use it? :]

You'll end up having something like this:

(new Image).src = "add?id=1&piece=0&data=abc";
(new Image).src = "add?id=1&piece=1&data=def";
:


If you don't need to send a good amount of data or if you need compatibility with old browsers, ok... Use the query string.

Or if you just want a simple way where you don't need the results (which is precisely what the OP wanted).

For me it will always look like what we call here "gambiarra". Yes! It's very simple, but it's a subversion of the feature, the Image is supposed to load images, not make fancy requests.

And that is not what the OP wanted - no response.

He's lost.

"Basically, I'm writing js errors to an error log on the server side - and there is no need to inform the user that the error has been logged."

He doesn't need to inform the user, but it would be nice to be sure that the error was logged right ;]


--
Jonas Raoni Soares Silva
http://www.jsfromhell.com
.



Relevant Pages

  • Re: How to; Click on pic to bring up a larger photo and a caption
    ... to run the graphic compression feature on all the images. ... Create a folder on your host server called "biography". ... photo with a biography will appear about that person under the photo. ... some way to get back to the page with the other fallen comrades. ...
    (microsoft.public.publisher.webdesign)
  • Re: How to; Click on pic to bring up a larger photo and a caption
    ... I suspect you have, but if not, be sure to run the graphic compression feature on all the images. ... Create a folder on your host server called "biography". ... photo with a biography will appear about that person under the photo. ... some way to get back to the page with the other fallen comrades. ...
    (microsoft.public.publisher.webdesign)
  • Re: How to; Click on pic to bring up a larger photo and a caption
    ... the graphic compression feature on all the images. ... Create a folder on your host server called "biography". ... photo with a biography will appear about that person under the photo. ...
    (microsoft.public.publisher.webdesign)
  • Re: RIS failure
    ... > I'm trying to set up RIS at first time. ... > Check of server succeds. ... >> from seeing custom images ("Choice Options" of Remote Installation>> Services ...
    (microsoft.public.windowsxp.setup_deployment)
  • Re: How resource-intensive are these?
    ... > stringing together 8 smaller images. ... > month, because another little script of mine, BattleFishies ... > everything will come crashing down, with smoke coming out of the server ... requests in 1 second for example. ...
    (alt.php)