ebooksgratis.com

See also ebooksgratis.com: no banners, no cookies, totally FREE.

CLASSICISTRANIERI HOME PAGE - YOUTUBE CHANNEL
Privacy Policy Cookie Policy Terms and Conditions
HTML scripting - Wikipedia, the free encyclopedia

HTML scripting

From Wikipedia, the free encyclopedia

HTML
This box: view  talk  edit

Contents

[edit] HTML Series

The W3C HTML standard includes support for client-side scripting. It defines how locally executable scripts may be used in a web page. A particular client-side application, such as a web browser, may support several script languages. Script code may be executed as the document loads or at a later time.

Script code can be written directly in the HTML document inside:

  • SCRIPT elements
  • Intrinsic event attributes

[edit] Script macros

[edit] The SCRIPT element type

SCRIPT elements may occur zero or more times within the HEAD and BODY elements. Scripts within script elements are processed as the document loads.

[edit] Intrinsic event attributes

Events occur for different elements of a web-page:

  • Documents (BODY and FRAMESET)
  • Forms
  • UI elements (Anchor, Control Element, Image)

Script code may be associated with an event and element by writing code in an HTML attribute. The name of the attribute must be that of a supported intrinsic event for the element (for example, "onLoad"). The script is executed whenever the event occurs for that element. These scripts are mostly Javascript. The HTML intrinsic event model consist of the following events:

  • Document
    • onLoad
    • onUnload
  • Form
    • onSubmit
    • onReset
  • Document and UI elements
    • Focus
      • onFocus
      • onBlur
  • UI elements
    • Mouse
      • Movement
        • onMouseOver
        • onMouseOut
        • onMouseMove
      • Button
        • onClick
        • onDblClick
        • onMouseDown
        • onMouseUp
    • Keyboard
      • onKeyPress
      • onKeyDown
      • onKeyUp
    • Other (TEXT/TEXTAREA)
      • Lost focus with modified content
        • onChange (also OPTION)
      • Text selection
        • OnSelect

Some browsers support additional event attributes (outside the standard), such as:

  • onResize
  • onMove
  • onScroll
  • onAbort

[edit] Script macros

Netscape Navigator supported a feature called "JavaScript entities" or "script macros" by which script code could be included in HTML attribute values, using a syntax similar to that of character entity references. For example, the code <img width="&{prompt('Width?')};" src="foo.jpg"> calls the JavaScript prompt() function to ask the user how wide the image should be.

The HTML 4.01 specification reserves a syntax for the "future support of script macros" in HTML attributes, but they have not been incorporated into later standards and are not supported by any current browser.


aa - ab - af - ak - als - am - an - ang - ar - arc - as - ast - av - ay - az - ba - bar - bat_smg - bcl - be - be_x_old - bg - bh - bi - bm - bn - bo - bpy - br - bs - bug - bxr - ca - cbk_zam - cdo - ce - ceb - ch - cho - chr - chy - co - cr - crh - cs - csb - cu - cv - cy - da - de - diq - dsb - dv - dz - ee - el - eml - en - eo - es - et - eu - ext - fa - ff - fi - fiu_vro - fj - fo - fr - frp - fur - fy - ga - gan - gd - gl - glk - gn - got - gu - gv - ha - hak - haw - he - hi - hif - ho - hr - hsb - ht - hu - hy - hz - ia - id - ie - ig - ii - ik - ilo - io - is - it - iu - ja - jbo - jv - ka - kaa - kab - kg - ki - kj - kk - kl - km - kn - ko - kr - ks - ksh - ku - kv - kw - ky - la - lad - lb - lbe - lg - li - lij - lmo - ln - lo - lt - lv - map_bms - mdf - mg - mh - mi - mk - ml - mn - mo - mr - mt - mus - my - myv - mzn - na - nah - nap - nds - nds_nl - ne - new - ng - nl - nn - no - nov - nrm - nv - ny - oc - om - or - os - pa - pag - pam - pap - pdc - pi - pih - pl - pms - ps - pt - qu - quality - rm - rmy - rn - ro - roa_rup - roa_tara - ru - rw - sa - sah - sc - scn - sco - sd - se - sg - sh - si - simple - sk - sl - sm - sn - so - sr - srn - ss - st - stq - su - sv - sw - szl - ta - te - tet - tg - th - ti - tk - tl - tlh - tn - to - tpi - tr - ts - tt - tum - tw - ty - udm - ug - uk - ur - uz - ve - vec - vi - vls - vo - wa - war - wo - wuu - xal - xh - yi - yo - za - zea - zh - zh_classical - zh_min_nan - zh_yue - zu -