- async—Optional. Indicates that the script should begin downloading immediately but should not prevent other actions on the page such as downloading resources or waiting for other scripts to load. Valid only for external script files. charset— Optional. The character set of the code specified using the srcattribute. This attribute is rarely used, because most browsers don’t honor its value.
- defer— Optional. Indicates that the execution of the script can safely be deferred until after the document’s content has been completely parsed and displayed. Valid only for external scripts. Internet Explorer 7 and earlier also allow for inline scripts.language— Deprecated. Originally indicated the scripting language being used by the code block (such as “JavaScript”, “JavaScript1.2”, or “VBScript”). Most browsers ignore this attribute; it should not be used.
- src— Optional. Indicates an external file that contains code to be executed.
- type— Optional. Replaces language; indicates the content type (also called MIME type) of the scripting language being used by the code block. Traditionally, this value has always been “text/javascript”, though both “text/javascript”and “text/ecmascript”are deprecated. JavaScript files are typically served with the “application/x-javascript”MIME type even though setting this in the typeattribute may cause the script to be ignored. Other values that work in non–Internet Explorer browsers are “application/javascript”and “application/ecmascript”. The typeattribute is still typically set to “text/javascript”by convention and for maximum browser compatibility. This attribute is safe to omit, as “text/javascript”is assumed when missing.
Thứ Tư, 21 tháng 8, 2013
The script element of javascript in HTML
Đăng ký:
Đăng Nhận xét (Atom)
Không có nhận xét nào:
Đăng nhận xét