Javascript¼¶Áª²Ù×÷´úÂë
js.js
var xmlDoc;
function cleanData(getObj)
{
if(getObj)
{
getObj.options.length = 0;
}
}
function getxmlDoc()
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.load("data.xml");
if(xmlDoc.parseError.errorCode!=0)
{
var myErr=xmlDoc.parseError;
alert("³ö´í£¡"+myErr.reason);
}
}
function InitData()
{
getxmlDoc();
var selectElement1=document.getElementById("Select1");
var selectElement2=document.getElementById("Select2");
cleanData(selectElement1);
cleanData(selectElement2);
var TopNodes = xmlDoc.getElementsByTagName("Root")[0].childNodes;
if(TopNodes.length>0)
{
var College;
var Department;
for(var i=0;i<TopNodes.length;i++)
{
//Ìí¼ÓÁбíÏîÄ¿
College=TopNodes[i];
var createOption=document.createElement("option");
createOption.value=College.getAttribute("id");
createOption.text=College.getAttribute("name");
selectElement1.add(createOption);
}
if(TopNodes[0].childNodes.length>0)
{
for(var j=0 ; j<TopNodes[0].childNodes.length;j++)
{
Department=TopNodes[0];
var createOption=document.createElement("option");
createOption.value=Department.childNodes[j].getAttribute("id");
createOption.text=Department.childNodes[j].getAttribute("name");
selectElement2.add(createOption);
}
}
}
}
function selectColl
Ïà¹ØÎĵµ£º
Ò»£¬Ç°ÑÔ
CookiesÏë±ØËùÓÐÈ˶¼Á˽⣬ µ«ÊÇδ±ØËùÓÐÈ˶¼¾«Í¨¡£±¾ÎĽ²½âÁËCookiesµÄ¸÷·½Ãæ֪ʶ£¬ ²¢ÇÒÌá³öÀ´ÁË×î¼Ñʵ¼ù¡£ÕâÊDZÊÕßÔÚÈÕ³£¹¤×÷ÖеĻýÀۺͳÁµí¡£
¶þ£¬»ù´¡ÖªÊ¶
1.ʲôÊÇCookies
Cookie ÊÇһС¶ÎÎı¾ÐÅÏ¢£¬°éËæ×ÅÓû§ÇëÇóºÍÒ³ÃæÔÚ Web ·þÎñÆ÷ºÍä¯ÀÀÆ÷Ö®¼ä´«µÝ¡£Cookie °üº¬Ã¿´ÎÓû§·ÃÎÊÕ¾µãʱ Web Ó¦ÓóÌÐò¶¼¿ ......
W3SchoolÊÇÒ»¸öºÜºÃµÄ³õѧÕßѧϰÍøÕ¾¡£ÏÂÃæµÄÊÇÀïÃæµÄÄÚÈÝ£¬Ö÷ÒªÊÇjavascript¶ÔÏóµÄAPI˵Ã÷ÓëʹÓã¬Ï£ÍûÔÚ²»¶®µÄʱºò¿ÉÒԺܷ½±ãµØ²é¿´µ½ËùÐèÒªµÄÒÉÎÊ¡£
JavaScript String ¶ÔÏó²Î¿¼ÊÖ²á
http://www.w3school.com.cn/js/jsref_obj_string.asp
JavaScript Date ¶ÔÏó²Î¿¼ÊÖ²á
http://www.w3school.com.cn/js/jsref_obj_dat ......
<script language="javascript" type="text/javascript">
function arrayTest() {
//ʹÓÃnew Array()
var array1 = ......
1.ECMAScriptµÄ»ù´¡¸ÅÄîÈçÏ£º
Çø·Ö´óСд
±äÁ¿Ê±ÈõÀàÐ͵Ä
ÿÐнáβµÄ·ÖºÅ¿ÉÓпÉÎÞ
×¢ÊÍÓëJava¡¢CºÍPHPÓïÑÔÏàͬ
»¨À¨ºÅ±íÃ÷´úÂë¿é
2.ÓëPython²»Í¬£¬ECMAScriptÖеıäÁ¿²»Ò»¶¨Òª³õʼ»¯£¬È磺
var test; //ÕýÈ·
3.±äÁ¿ÃûÐèÒª×ñÊØÁ½Ìõ¼òµ¥µÄ¹æÔò£º
µÚÒ»¸ö×Ö·û±ØÐëÊÇ×Öĸ¡ ......