2013年6月25日 星期二

開放的 DNS Server

Google DNS
Preferred: 8.8.8.8
Alternate: 8.8.4.4
OpenDNS
Preferred: 208.67.222.222
Alternate: 208.67.220.220
Reference: http://getpocket.com/a/read/383826640 

2013年6月19日 星期三

Web 相關的保留字

Cookie 的保留字 = 和 ;
URL 的保留字 ? & =
HTML 保留字 " ' & < >

更詳細的可以 Reference: rfc3986

2013年5月9日 星期四

2013年5月7日 星期二

可以在 Client 端暫存資料的地方

要在 Client 端的瀏覽器暫存資料,不受瀏覽器 Reload 的影響可以利用:

1. Address Bar (帶在 URL 中)
2. Cookie

暫存的資料需考慮安全性問題。

2013年2月24日 星期日

產生 Event 並傳送給指定的 Element


1. Create event

createEvent / createEventObject

2. Initial event
根據我們建立 Event 的方式決定初始化的方式

3. Dispatch event
dispatchEvent / fireEvent

PS. 要考慮到瀏覽器相容性的問題。

2013年2月18日 星期一

網頁上英文字因為換行被截斷的問題

CSS 的解法:

word-break
word-wrap

JavaScript 的解法:

style.wordBreak
style.wordWrap

2013年2月5日 星期二

在 Firefox 3.5 上遇到的 reload 問題

##
you might call the same page but let it look like it is an other page by changing the querystring:
window.location.href = "index.html" + "?" + Date.parse(new Date());
This works for every browser. You could improve it by extracting the current page out of location.href.
Edit:
If you already have an existing querystring you have to use & insead of ?:
window.location.href = "product.aspx?id=prod" + "&" + Date.parse(new Date());
##

Reference:
http://stackoverflow.com/questions/1536900/force-a-page-refresh-using-javascript-in-firefox