views:

117

answers:

3

I was told that using javascript to submit in either asp or asp.net causes a faster submit. Is this true or is there no significant difference?

+3  A: 

I wouldn't think so? Your browser would have the extra overhead of executing your JS (depending on how complicated your JS is) and then submitting the form. I would want to think that submitting a form the classic way is faster than submitting the form using JS. And, your server side technology should not really matter (asp/asp.net/jsp/whateva)- it is unrelated to JS.

Jay
To whoever it is who voted my answer down: I am not sure why you would down vote my answer, I would think that you would have the presence of mind to leave a comment explaining your argument.
Jay
+3  A: 

Assuming you're talking about HTML form submissions from the browser to the server then neither is faster. Regardless of how a submission is done, the browser must transmit the data from the user's machine to the server.

Bryan Kyle
You see Bryan I thought that too. But we had two applications that were nearly identical on a mobile device. One submitting with Javascript and the other normally. The javascript submission was faster by about 3 seconds. We've tested it multiple times. But do you think it was because it was on a mobile device?
Eric
@Eric are those two applications submitting the same form with the same amount of data? Have you considered the network latency involved? Your data connection might depend on your network signal?
Jay
@Eric how exactly did you come up with the 3 second measure? How did you measure the difference?
Jay
Yes,I've considered those things but the difference in speed was too large in every test and at different times. However, we tested on two different mobile devices so one signal may have been a little stronger. So good point.
Eric
To prove a point, you could test your applications using a mobile emulator. I remember this emulator that you would run on your computer for J2ME apps. You would load your MIDPs into it and run them, eliminating the data latency factors. (if you were using apps written in J2ME)
Jay
A: 

There should be a slight overhead doing it with Javascript, and it depends on client machine performance.

Thevs