Time of Update: 2015-07-15
標籤:閉包// 建立一個建構函式quo// 它帶有get_status方法和status私人屬性var quo = function(status){ return { get_status: function(){ return status; } };};var myQuo =
Time of Update: 2015-07-15
標籤:javascript本文題目1:if (!("a" in window)) { var a = 1;}alert(a); 題目2var a = 1, b = function a(x) { x && a(--x); };alert(a); 題目3:function a(x) { return x * 2;}var a;alert(a); 題目4:function b(x, y, a) {
Time of Update: 2015-07-15
標籤:1.HTML 中的指令碼必須位於 <script> 與 </script> 標籤之間。指令碼可被放置在 HTML 頁面的 <body> 和 <head> 部分中2.如需從 JavaScript 訪問某個 HTML 元素,您可以使用 document.getElementById(id)
Time of Update: 2015-07-15
標籤:Delete Node in a Linked ListWrite a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed the linked list is 1 -> 2 -> 3 -> 4 and you are given the third node with
Time of Update: 2015-07-15
標籤:Array:數組push:往數組末尾添加值,可以是一個或者多個。 alert(arr.push(4, 5))join:串連數組元素,中間有分隔字元。 var str = arr.join(" "); alert(str);reverse:點到數組的順序,是操作本身。 alert(arr.reverse()); splice:增加或刪除元素 var arr = new Array(6); arr[0] =
Time of Update: 2015-07-14
標籤:Unique PathsA robot is located at the top-left corner of a m x n grid (marked ‘Start‘ in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right
Time of Update: 2015-07-13
標籤: D3(Data-Driven Documents)是一個用於網頁作圖、產生互動圖形的JavaScript函數庫。 官網:http://d3js.org/ 下載: cdn:<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" charset="utf-8"></script> d3.zip1.hello world
Time of Update: 2015-07-12
標籤:Lowest Common Ancestor of a Binary Search TreeGiven a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined
Time of Update: 2015-07-12
標籤:Delete 操作在數組與對象之間的差異對數組進行 delete 運算,效果與對對象進行 delete 運算不同;見下://delete操作在對象和數組之間的不同//先刪除對象的屬性var originObj={name:‘Spark‘,inner:{top:‘shirt‘,short:‘T-string‘}};delete originObj.inner;for (var prop in originObj){?document.write(prop);}//->
Time of Update: 2015-07-12
標籤:javascript html 定時器 settimeout setinterval javascript有兩種定顯示器, setTimeout和setInterval,下面簡要介紹兩個函數然後附上簡單的例子。setTimeout(function, time) ,
Time of Update: 2015-07-16
html
Time of Update: 2015-07-16
json字串解析package com.gamesvr.framework.util;import java.beans.IntrospectionException;import java.beans.Introspector;import java.beans.PropertyDescriptor;import java.math.BigDecimal;import java.math.BigInteger;import java.util.*;import
Time of Update: 2015-07-16
jquery獲得當前html頁面源碼的方法,jquery源碼本文執行個體講述了jquery獲得當前html頁面源碼的方法。分享給大家供大家參考。具體實現方法如下:$("#btnGetCode").click(function(){ var a = '<!DOCTYPE html><html lang="zh-cn">'; var z = "</html>" var by = $(":root").html();
Time of Update: 2015-07-15
javascript範圍問題執行個體分析,javascript執行個體分析最近做項目過程中需要根據JSON資料產生一個樹狀的目錄,結果代碼如下:var folderList=[ { "FolderName": "ASD", "ChildList": null }, { "FolderName": "內網公告", "ChildList": null }, { "FolderName": "測試文檔", "ChildList": null }, {
Time of Update: 2015-07-14
angularJS 報錯: [ngModel:numfmt] http://errors.angularjs.org/1.4.1/ngModel/numfmt?p0=333,angularjsngmodel<!doctype html><html ng-app="a10086"><head> <meta charset="utf-8"> <script src="angular.min.js"></script>
Time of Update: 2015-07-13
如何設定div的透明度但是其中的文字不透明,div透明度不透明如何設定div的透明度但是其中的文字不透明:設定div透明度的時候可能很多朋友會遇到這樣一個問題,那就是對象中的文字也被產生了透明現象,也不能說事缺陷,也可能有時候需要這樣的效果。這裡就介紹一下如何將對象設定為透明效果,但是文字不透。代碼執行個體如下:<!DOCTYPE html><html><head><meta charset=" utf-8"><meta
Time of Update: 2015-07-13
javascript 事件對象在js中觸發一個事件的時候,會產生一個事件對象,也就是函數處理常式中的event,通過event我們可以訪問到所有與事件有關的資訊,如事件的類型、事件發生對象等等。需要注意的是關於event對象IE 和 非IE在支援方式不同。DOM中的事件對象不管是標籤內綁定事件,DOM0級還是DOM2級,事件處理常式都會傳入一個event。按鈕1...var btn = document.getElementById(button);btn.onclick = function(
Time of Update: 2015-07-13
最全面的JS表單驗證 兩個日期比較 /*用途:檢查開始日期是否小於等於結束日期輸入:s:字串 開始日期 格式:2001-5-4e:字串 結束日期 格式:2002-5-4返回:如果通過開始日期小於等於結束日期返回true,否則返回false*/function data_compare(s,e){var arr=s.split(-);var starttime=new Date(arr[0],arr[1],arr[2]);...更多 兩個日期比較
Time of Update: 2015-07-13
javascript 事件處理【寫在前面】最近一直在看js的基礎,畢竟jquery雖然好用,總歸是用著別人寫的,只會用api不如搞清楚實現的原理。等把js基礎鞏固好了一定要去讀jquery的源碼。事件流事件流描述的是從頁面中接收事件的順序。js中有兩種事件流,冒泡流和捕獲流。兩種流的名稱都很形象,在由節點構成的一顆html樹上面,冒泡流指事件開始時候由最具體的元素最先接收,然後逐級傳播到最不具體的節點,比如在如下文檔中: 當單擊div時,事件首先在div上響應,然後傳到body元素上,
Time of Update: 2015-07-12
CSS3文字立體效果,css3文字<!DOCTYPE HTML><html lang="en-US"><head><meta charset="UTF-8"><title>很棒的CSS3立體效果</title></head><body><div>http://www.999jiujiu.com/</div> <style>