Content deleted Content added
Cybercobra (talk | contribs) Reverted 1 edit by 94.43.5.59 (talk): Not significant enough. (TW) |
→Use in web pages: Updated with more modern examples |
||
Line 275:
The most common use of JavaScript is to write functions that are embedded in or included from [[HTML]] pages and that interact with the [[Document Object Model]] (DOM) of the page. Some simple examples of this usage are:
* Loading new page content or submitting data to the server via [[AJAX]] without reloading the page (for example, a social network might allow the user to post status updates without leaving the page)
* Animation of page elements, fading them in and out, resizing them, moving them, etc.
* Interactive content, for example games, and playing audio and video
* [[Data validation|Validating]] input values of a [[form (web)|web form]] to make sure that they are acceptable before being submitted to the server.
* Transmitting information about the user's reading habits and browsing activities to various websites. Web pages frequently do this for [[web analytics]], [[ad tracking]], [[personalization]] or other purposes.<ref>{{cite web | url=http://piwik.org/docs/javascript-tracking/ | title=JavaScript tracking - Piwik | publisher=[[Piwik]] | accessdate=31 March 2012 17:56 (UTC)}}</ref>
|