Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
Can I get some help with this javascript question? Not sure what to write, especially for the AJAX bit.?
“JavaScript was one of the great bad ideas of the web” Do you agree with this statement giving reasons to support your answer. + need to mention Ajax
1 Answer
- just "JR"Lv 76 years agoFavorite Answer
"Bad idea", I disagree: javascript allows you to perform countless operations on client side, before being obliged to link to the server.
i.e.
You create a form. With javascript, you can check the form BEFORE seding it to the server. No need to refresh, no need to extra-comms with the server.
AJAX? Another big advantage!
Say you register a new user, and no two users on your site can be the same.
You set-up a form. The user enters his new "username".
Your javascript will detect that you completed the field (onblur()). You call javascript to do an AJAX call (invisible to user). The username is sent to the server. You check that user exists or not (ie php/mysql). You return "ok" or "that user already exists" to the client.
==> the form has been checked BEFORE being sent!
==> a message can be displayed in case of "error" or "acceptance".
If we did not have javascript, every thing we do will have to be sent to the server, increasing the amount of communication with the server, as well as the risk of being "intercepted" by "watchers"...