HTML5的placeholder屬性無非只是一個補缺的功能。那些IE9-都要使用JS去類比,網上也有不少外掛程式,但是發現在IE中,這些版本都有一些問題。無意中到了一個JQ寫的,沒有寫成外掛程式,反正考慮到了這一點。 $(document).ready(function(){// var supportPlaceholder = 'placeholder' in document.createElement('input');if(!Modernizr.input.placeholder){
有時候,想要知道事件到底是哪個對象觸發的。例如,給P元素一個點擊的事件,當點擊了P後,P就會響應。我們就是P是事件的目標。送上一個小例子:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html
我們都知道,在使用DOM的時候給我們帶來了極大的方便。然後卻少了一個getElementsByClass,我們知道,Class在JS和眾多語言中都是一個保留字,所以才沒有這個方法,但這隻是我的胡扯。function getElementsByClass(node,searchClass,tag) { var classElements = new Array(); if ( node == null ) node = document; if ( tag == null ) tag =
There’s one very important difference between these two methods, and it’s not that one accepts only a tag name and the other accepts a full CSS selector. The big difference is in the return value: the getElementsByTagName() method returns a
開啟ST2的時候,發現突然彈出一個新的Tab:Package Control Messages========================ZenCoding:--------- This Zen Coding plugin is outdated and will never receive any updates in future. In two weeks the repo will be unpublished. Consider switching to Emmet --
Firebug教程Section 1: Console Tab : Logging, Profiling and CommandLine (Part II)Overview of Console TabThis tab is mainly used for logging. It also can be used as CommandLine window (like immediate window in Microsoft Visual Studio) while you are
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>An XHTML 1.0 Strict standard
很多人都不知道怎麼下載Chrome 瀏覽器商店的外掛程式:Find the ID of the extension you’re interested in. When on the details page of the extension, it will be something likebfbmjmiodbnnpllbbbfblcplfjjepjdnafterhttps://chrome.google.com/webstore/detail/Paste this
我承認,我不是一個合格的前端。學得不好,差點在Stack上問了傻問題。問題是這樣的,我試了一下下面的運算子:var s = 'string';console.log(s instanceof String);//output false,so do Object.我就有點傻了,這個不是字串嗎?答案就不繞了,因為這隻是一個字串,普通類型。當它使用方法的時候,會自動封裝成字串類,所以能用String的方法。用完後立刻銷毀,不知道我記得的有沒有錯。換成這樣,答案就一目瞭然。var s = new
打算認真學習一次PHP,前端屌絲的專心語言。Nodejser別噴我了,先學這個吧。N久之前裝過一次PHP環境,很久沒用,我以為沒有裝過,又重裝了一次,這次找到一個apache2.0.60,應該是這個版本,才發現自己還有一個,2.2.22。而且還是有問題,具體什麼問題就是根本不是網站伺服器。我把它們都刪除了,然後再安裝apache2.2.22。居然提示安裝失敗。系統找不到指定的檔案: No installed service