Posts

Showing posts with the label T-HTML

HTML5 Application Cache

With application cache it is easy to make an offline version of a web application, by creating a cache manifest file. What is Application Cache? HTML5 introduces application cache, which means that a web application is cached, and accessible without an internet connection. Application cache gives an application three advantages: Offline browsing - users can use the application when they're offline Speed - cached resources load faster Reduced server load - the browser will only download updated/changed resources from the server Cache Manifest Basics To enable application cache, include the manifest attribute in the document's <html> tag: <!DOCTYPE HTML> <html manifest= "demo.appcache" > . . . </html> Every page with the manifest attribute specified will be cached when the user visits it. If the manifest attribute is not specified, the page will not be cached (unless the page is specified directly in the manifest fi

HTML5 Web Workers

A web worker is a JavaScript running in the background, without affecting the performance of the page. What is a Web Worker? When executing scripts in an HTML page, the page becomes unresponsive until the script is finished. A web worker is a JavaScript that runs in the background, independently of other scripts, without affecting the performance of the page. You can continue to do whatever you want: clicking, selecting things, etc., while the web worker runs in the background. Check Web Worker Support Before creating a web worker, check whether the user's browser supports it: if   ( typeof (Worker) !==   "undefined" ) {       // Yes! Web worker support!       //   Some code..... }   else   {       // Sorry! No Web Worker support.. } Create a Web Worker File Now, let's create our web worker in an external JavaScript. Here, we create a script that counts. The script is stored in the "demo_workers.js" file: var   i =   0 ; fu

HTML Global Attributes

HTML attributes give elements meaning and context. The global attributes below can be used on  any  HTML element HTML Global Attributes = Attribute added in HTML5. Attribute Description accesskey Specifies a shortcut key to activate/focus an element class Specifies one or more classnames for an element (refers to a class in a style sheet) contenteditable Specifies whether the content of an element is editable or not data-* Used to store custom data private to the page or application dir Specifies the text direction for the content in an element draggable Specifies whether an element is draggable or not dropzone Specifies whether the dragged data is copied, moved, or linked, when dropped hidden Specifies that an element is not yet, or is no longer, relevant id Specifies a unique id for an element lang Specifies the language of the element's content spellcheck Specifies whether the element is to have its spelling and grammar checked or not style Specifies an i

HTML Event Attributes

Global Event Attributes HTML 4 added the ability to let events trigger actions in a browser, like starting a JavaScript when a user clicks on an element. To learn more about programming events, please visit our   JavaScript tutorial. Below are the global event attributes that can be added to HTML elements to define event actions.

HTML Character Sets

Common HTML Character Sets ANSI was the first official default character set in Windows. The default character set in HTML 4 was 8859-1. The default character set in HTML 5 is UTF-8. For a closer look, visit our   Complete HTML Character Set Reference. Number ASCII ANSI 8859-1 UTF-8 Description 32 space 33 ! ! ! ! exclamation mark 34 " " " " quotation mark 35 # # # # number sign 36 $ $ $ $ dollar sign 37 % % % % percent sign 38 & & & & ampersand 39 ' ' ' ' apostrophe 40 ( ( ( ( left parenthesis 41 ) ) ) ) right parenthesis 42 * * * * asterisk 43 + + + + plus sign 44 , , , , comma 45 - - - - hyphen-minus 46 . . . . full stop 47 / / / / solidus 48 0 0 0 0 digit zero 49 1 1 1 1 digit one 50 2 2 2 2 digit two 51 3 3 3 3 digit three 52 4 4 4 4 digit four 53 5 5 5 5 digit five 54 6 6 6 6 digit six 55 7 7 7 7 digit seven 56 8 8 8 8 digit eight 57 9 9 9 9 digit nine 58 : : : : colon 59 ; ; ; ; semicolo