After following, you can keep track of his dynamic information in a timely manner
Courses in the relevant section:HTML5 Server-Sent Events
var source = new EventSource("demo_sse.php"); source.onmessage = function(event) { document.getElementById("result").innerHTML += event.data + "<br />"; };
2016-11-250個贊
Courses in the relevant section:JavaScript global variables and local variables
全局變量 可以在網(wǎng)頁的任何地方(函數(shù)內(nèi)部和函數(shù)外部)使用的變量,就是“全局變量”。 在函數(shù)外部定義的變量,就是“全局變量”。 全局變量”既可以在函數(shù)外使用,也可以在函數(shù)內(nèi)部使用。 “全局變量”在網(wǎng)頁關(guān)閉時,自動消失(釋放空間)。 局部變量 只能在函數(shù)內(nèi)部使用的變量,稱為“局部變量”。 “局部變量”在函數(shù)內(nèi)部定義,在函數(shù)內(nèi)部使用。 “局部變量”在函數(shù)外部無法訪問。 “局部變量”在函數(shù)執(zhí)完完畢就消失了。
2016-11-240個贊
Courses in the relevant section:HTML5 coding standards
<meta charset="utf-8" />在 XHTML 和 XML 中斜線 (/) 是必須的
2016-11-250個贊
Courses in the relevant section:Copy-by-value and reference-by-value in JavaScript
拷貝傳值,就是將一個變量的值“拷貝”一份,傳給了另一個變量。 拷貝傳值完之后,兩個變量之間沒有任何聯(lián)系,修改其中一個變量的值,另一個不會改變。 這兩個變量之間,是相互獨立的,沒有任何聯(lián)系。
2016-11-240個贊
Courses in the relevant section:Anonymous functions in JavaScript
匿名函數(shù),不能單獨定義的,也不能單獨調(diào)用。 匿名函數(shù),一般是作為數(shù)據(jù)給其它變量賦值的??梢越o普通變量、數(shù)組元素、對象的屬性賦值。
2016-11-240個贊
Courses in the relevant section:What are events in JavaScript
指的是文檔或者瀏覽器窗口中發(fā)生的一些特定交互瞬間。我們可以通過偵聽器(或者處理程序)來預(yù)定事件,以便事件發(fā)生的時候執(zhí)行相應(yīng)的代碼
2016-11-240個贊
Courses in the relevant section:JavaScript mouse click event (onclick)
<form> <input name="點我看看" type="button" value="點我看看" onclick="fun1()"/> <p onclick="fun2()">不要點我</p> </form> <script> function fun1(){ window.alert("歡迎來到php.cn") } function fun2(){ window.alert("你看,你還是點了我") } </script>
2016-11-240個贊
Courses in the relevant section:JavaScript mouse over event (onmouseover)
當(dāng)鼠標(biāo)移到一個對象上時,該對象就觸發(fā)onmouseover事件
2016-11-240個贊
Courses in the relevant section:JavaScript mouse move event (onmouseout)
當(dāng)鼠標(biāo)移開當(dāng)前對象時,執(zhí)行onmouseout調(diào)用的程序。
2016-11-240個贊
Courses in the relevant section:JavaScript cursor focus event (onfocus)
<input name="username" type="text" value="請輸入姓名" onfocus="fun()" > <script> function fun(){ window.alert("請輸入真實姓名") } </script>
2016-11-240個贊
Courses in the relevant section:JavaScript cursor out-of-focus event (onblur)
onblur事件與onfocus是相對事件,當(dāng)光標(biāo)離開當(dāng)前獲得聚焦對象的時候,觸發(fā)onblur事件,同時執(zhí)行被調(diào)用的程序
2016-11-240個贊
Courses in the relevant section:JavaScript content selection event (onselect)
當(dāng)文本框或者文本域中的文字被選中時,觸發(fā)onselect事件,同時調(diào)用的程序就會被執(zhí)行
2016-11-240個贊
Courses in the relevant section:JavaScript text box content change event (onchange)
通過改變文本框的內(nèi)容來觸發(fā)onchange事件,同時執(zhí)行被調(diào)用的程序。
2016-11-240個贊
Courses in the relevant section:JavaScript loading event (onload)
<!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>php.cn</title> <script> function fun(){ window.alert("加載中......") } </script> </head> <body onload="fun()"> 歡迎來到php.cn </body> </html>
2016-11-240個贊
Courses in the relevant section:JavaScript object basics
String對象:字符串對象,提供了對字符串進(jìn)行操作的屬性和方法。 Array對象:數(shù)組對象,提供了數(shù)組操作方面的屬性和方法。 Date對象:日期時間對象,可以獲取系統(tǒng)的日期時間信息。 Boolean對象:布爾對象,一個布爾變量就是一個布爾對象。(沒有可用的屬性和方法) Number對象:數(shù)值對象。一個數(shù)值變量就是一個數(shù)值對象。 Math對象:數(shù)學(xué)對象,提供了數(shù)學(xué)運算方面的屬性和方法。
2016-11-240個贊