HTML 5 <script> ��ǩ

�������÷�

<script> ��ǩ����һ�νű������� JavaScript��

���� async ����Ϊ true�����ű����������ĵ������ಿ���첽ִ�У������ű���������ҳ�����������Ĺ�������ִ�С�

���� async ����Ϊ false���� defer ����Ϊ true�����ű�����ҳ�����ɽ���ʱ�õ�ִ�С�

���� async �� defer ���Ծ�Ϊ false����ô�ű�������ִ�У�ҳ�����ڽű�ִ�����ϼ���������

HTML 4.01 �� HTML 5 ֮���IJ���

�� HTML 5 �У���һЩ�����ԣ�ͬʱ����֧�� HTML 4.01 �е�һЩ���ԡ�

��ʾ��ע��

��ʾ���������� src ���ԣ��� <script> ��ǩ�����ǿյġ�

����

<script type="text/javascript">
document.write("Hello World!")
</script>

����

���� ֵ ���� 4 5
async
  • true
  • false
�����ű��Ƿ��첽ִ�С�   5
type
  • text/ecmascript
  • text/javascript
  • application/ecmascript
  • application/javascript
  • text/vbscript
ָʾ�ű��� MIME ���͡� 4 5
charset charset �����ű���ʹ�õ��ַ����롣��֧�֡� 4  
defer
  • true
  • false
ָʾ�ű����������κε��ĵ����ݡ����������Լ�������������ҳ�档 4 5
language
  • javascript
  • livescript
  • vbscript
  • other
�涨�ű����ԡ����޳�ʹ�á���ʹ�� type ���Դ������� 4  
src URL ����ָ�������ű����ļ��� URL���������Ϳ�������ij�������ű����ļ���������ֱ�Ӱѽű��������� HTML �ĵ��У��� 4 5

��׼����

class, contenteditable, contextmenu, dir, draggable, id, irrelevant, 
lang, ref, registrationmark, tabindex, template, title

���������������������� HTML 5 �б�׼������

�¼�����

onabort, onbeforeunload, onblur, onchange, onclick, oncontextmenu, 
ondblclick, ondrag, ondragend, ondragenter, ondragleave, ondragover, 
ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress, onkeyup, 
onload, onmessage, onmousedown, onmousemove, onmouseover, onmouseout, 
onmouseup, onmousewheel, onresize, onscroll, onselect, onsubmit, onunload

���������������������� HTML 5 ���¼�������

TIY ʵ��

����һ�νű�
������ʾ���ν��ű����� HTML �ĵ���
�����ڲ�֧�ֽű���������
������ʾ���ζԸ���֧�ֽű�����������