Javascript DOMѧϰ±Ê¼Ç1
·µ»ØÒ»¸ö¸ø¶¨idÊôÐÔÖµµÄÔªËØ½ÚµãµÄ¶ÔÏó
document.getElememtById(id)
·µ»ØÒ»¸ö°üº¬ËùÓиø¶¨±êÇ©µÄÔªËØµÄÊý×é
document.getElementsByName(tag)
»ñÈ¡ÔªËØÊôÐÔ
document.getAttribute(attribute)
ÉèÖÃÔªËØÊôÐÔÖµ
document.setAttribute(attribute)
Ïà¹ØÎĵµ£º
Ò»¡¢Ö÷Ò³Ãæ(²ÉÓÃjspʵÏÖ)
<%@ page language="java" contentType="text/html; charset=gb2312"
pageEncoding="gb2312"%>
<%@page import="org.accp.jwebplayer.biz.MusicBiz"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<h ......
jsÈçºÎʵÏÖÔÚÒ³ÃæÍêÈ«¼ÓÔØºóÖ´ÐÐjavascriptº¯Êý»ò/´úÂëÄØ?
¿ÉÒÔÊÇÒÔϼ¸ÖÖ
<body onload="function name()" > </body >
<script >window.onload=function name </script >
<script language="javascript" for="window" event="onload" >function name(); </script >
µ ......
×ªÔØ×Ô£ºhttp://www.ruanyifeng.com/blog/2009/09/find_element_s_position_using_javascript.html
Áíһƪ£ºhttp://blog.csdn.net/ivan820819/archive/2009/09/03/4515122.aspx
ÖÆ
×÷
ÍøÒ³µÄ¹ý³ÌÖУ¬ÄãÓÐʱºòÐèÒªÖªµÀij¸öÔªËØÔÚÍøÒ³ÉϵÄÈ·ÇÐλÖá£
ÏÂÃæµÄ½Ì³Ì×ܽáÁËJavascriptÔÚÍøÒ³¶¨Î»·½ÃæµÄÏà¹ØÖª
ʶ¡£
Ò»¡¢ÍøÒ³µ ......
´´½¨ÎĵµÔªËØ
document.createElement(nodename)
²åÈëÔªËØµ½Îĵµ½ÚµãÊ÷
parent.appendChild(child)
´´½¨Îı¾½Úµã
document.createTextNode(text)
ÔÚÏÖÓÐÔªËØÇ°²åÈëÐÂÔªËØ
parentElement.insertBefore(newElement,targetElement)
ÔÚÏÖÓÐÔªËØºó²åÈëÐÂÔªËØ£¨×ԱຯÊý£©
parentElement.insertAfter(newElement,targe ......
¼ìË÷:
1 ÓÃ||À´Ìî³äĬÈÏÖµ
var status = flight.status || "unknown";
2 ʹÓÃ&&·ÀÖ¹TypeError
flight.equipment.model //throw "TypeError"
flight.equipment && flight.equipment.model //undefined
ÒýÓÃ
var a={},b={},c={};
document.writeln(a===b); //false
ÔÐÍ
Javascript ......