Difference Between AJAX and Javascript
When we view certain websites, we are after the data that is in it. And a whole page is normally not enough to hold everything we want to know, therefore there is a need to link the current page to the next one. But sometimes we don’t need to or even want to change the whole page, just the a certain section in it. For example, we have a shoutbox in a page, we wouldn’t want the whole page to reload whenever a new entry appears on the screen.
The first to provide this sort of functionality was Java, providing little compiled applets that can load data asynchronously. Later on, AJAX provided the standard the allowed coders to request data asynchronously in order to change the load new data without changing the web page.
Javascript, on the other hand, is a client side scripting language that allows the creation of dynamic web pages providing a new level of interactivity. The advantage of JavaScript is that since it’s a client side application, it can create dynamic web pages that are more complex than what a server side script can do. Server side scripts are run by the host machine and thus, has very limited resources especially when there are a lot of people accessing that server. Being on the client computer, Javascript has a lot of resources to play regardless of the activity on the server.
The prime drawback of Javascript is that it is a very good candidate for a trojan to be installed into your computer. Because it runs on the client, it is authorized some resources that could potentially give control of your computer to an outsider, potentially getting you included in a botnet. The remedy to this drawback is by not allowing untrusted javascript codes from being run on your computer.
AJAX and Javascript are related due to the fact that AJAX is the methodology used by Javascript to obtain most of its data from the server. When Javascript is creating dynamic web pages, it doesn’t request for everything that it might eventually need from the server because this would cause a very long loading time. Instead, it just loads what it needs to load the first page. Whenever a user does something that would need more data, Javascript would then use AJAX to request for the needed data in order to avoid reloading the page.
As we can see, AJAX is just another tool that can be used by scripting languages like Javascript in order to enhance the look and feel of their web pages.
Check out Books related to AJAX and Javascript.
- Difference Between Sony Cybershot S Series and W Series - December 22, 2012
- Difference Between Samsung Galaxy S3 and iPhone 5 - December 21, 2012
- Difference Between Samsung Galaxy S2 (Galaxy S II) and Galaxy S 4G - December 20, 2012
Search DifferenceBetween.net :
Email This Post : If you like this article or our site. Please spread the word. Share it with your friends/family.