Re: "AJAX" - sending but don't need response?
- From: Jonas Raoni <jonasraoni@xxxxxxxxx>
- Date: Tue, 07 Mar 2006 04:18:31 -0300
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
.
- Follow-Ups:
- Re: "AJAX" - sending but don't need response?
- From: Randy Webb
- Re: "AJAX" - sending but don't need response?
- References:
- "AJAX" - sending but don't need response?
- From: Tony
- Re: "AJAX" - sending but don't need response?
- From: Randy Webb
- Re: "AJAX" - sending but don't need response?
- From: Jonas Raoni
- Re: "AJAX" - sending but don't need response?
- From: Randy Webb
- "AJAX" - sending but don't need response?
- Prev by Date: Re: Modal dialog doesn't threads to sleep in Firefox?
- Next by Date: Re: "AJAX" - sending but don't need response?
- Previous by thread: Re: "AJAX" - sending but don't need response?
- Next by thread: Re: "AJAX" - sending but don't need response?
- Index(es):
Relevant Pages
|