Facebook app – 由 HTML5 回到 原生 iOS app

Facebook 曾打響旗號,將其 iPhone app 和 android app 改為以 app container 配合 HTML5 來製成適合智能手機上使用的 mobile web app,一時將 HTML5 的風吹得熾熱,讓人們覺得 HTML5 web-based apps (a.k.a HTML5 app)正是手機程式開發的理想方向之一。然而近來又似乎在打退堂鼓…… Continue reading Facebook app – 由 HTML5 回到 原生 iOS app

Win 8 IE10 初體驗﹣Front-end Web Developer 迎接 Win 8 IE 10 的挑戰

對於電腦使用者的你來說,WINDOW 8 的面世是一項電腦應用的新體驗。新的 Metro UI 一改沿用多年的介面,應對 iOS 的簡單介面而作出適合手提儀器改良的新介面。
Continue reading Win 8 IE10 初體驗﹣Front-end Web Developer 迎接 Win 8 IE 10 的挑戰

New Lane Crawford site

It is incredible I have chance to participate in building up the Lane Crawford official site.

The visible website is just the tip of the whole iceberg. In the last 14 months, started from a 6 people team, we build up the whole project linking up various internal systems, collaborate with our vendor and overcoming different hardship. We finally come up with a presentable website. Yet it looks simple, the site aim to serve various browsers especially IE6. Yes, as its target audience is from the mainland… Continue reading New Lane Crawford site

Angelo’s Pizza is launched!!!

With an occasion brought by my colleague, I have a chance to offer my spare skill on building website for a well-known Italian restaurant, which open a new branch of dining service: Pizza Delivery – Angelo’s Pizza.

The site is customized CMS driven, bilingual, provide web master easier way to manage the site content.

Its mobile version is coming soon.

TypeKit and Web Fonts

For the project I currently come across is a very stylished corporation website. The site’s designer intends to use special font-face to empharise the brand feeling. This allows me find out something call TypeKit and Web Fonts.

In early web development period, whenever web designer need to use special font face, they may require people to download and install that particular font to client machine. When CSS turns out to a more widely used pratice for web layout control, we use font-family for assigning the font-face we use. But these techniques not yet help web designer to achieve something they want: the use of special, non-widely adopted font face, to their web product.

TypeKit and Web Fonts come to the place for this purpose, with the evolution of cloud service development. TypeKit and Web Fonts acts as a font provider for online purpose. They work in this way:

  1. Web designer sign up for the online font service
  2. Select font face that provided by TypeKit/Web Fonts and define CSS selector for assign font-face effect
  3. Generate JavaScript Snipplet for the fonts service
  4. Put the snipplet to designated web page so as to provides necessary font resource to the web page the snipplet was adopted. Designated CSS selector will take effect with the web font

Therefore, without explicitly storing the font raw file, no installation step on client side. By this mean, web designer can use their ideal font and client side can enjoy the visual effect without any extra font installation.

TypeKit does not provide as many font as Fonts.com Web Fonts provides. And as a Chinese, what I can observe is that TypeKit does not provide any chinese font-face.

Making good use of this technique can definitely help enhancing web layout while not affecting the site SEO concern, say no longer need to use image replacement to show special font design in some case.

Typekit: http://typekit.com/

Fonts.com Web Fonts: http://webfonts.fonts.com/

Cross Browser Compatibility & Progressive Enhancement

隨著網路的發展,網頁所包含的不單止有文字圖案,不同種類的多媒體應用漸漸被應用於一些尖端前衛的網站上,固有的瀏覽器未必能應付這樣的需求。由Internet Explorer vs Netscape 的年代開始,瀏覽器的戰爭自此沒有停過。林林種種的瀏覽器出現,Firefox, Chrome, Safari, Opera等等,對用家來說是多了選擇,對Web Developer來說分分鐘是惡夢的開始。

假如各門路的瀏覽器能夠把任何一個網頁都一致地呈現,這是最理想的情況。但事實上各家各有自己對網頁的編譯方法,甚至運行上的不同做法,都使 Web Developer 再神勝不過。意思說,作為 Web Developer ,有責任的話,他需要讓其製作的網頁能在絕大部份的瀏覽器 / 視窗平台中順利運行,這就是所謂 Cross Browser Compatibility 。要做到這點,並不是把一切基本網頁編寫的 HTML,JavaScript 學會就是了。還得要從各個瀏覽器的特性方面著手。由標準HTML (W3C Standard HTML)學起,到逐步了解不同瀏覽器對 HTML 的演譯方法,接著學寫標準的JavaScript,並且查找某些JavaScript在不同瀏覽器中編寫文法的例外,到較後學習如何利用CSS對版面作改動,與及留意不同瀏覽器所支援的 CSS 版本,為網頁作出適當的 CSS 調整。

從前 Cross Browser Support 主要依賴人手在各個瀏覽器上作測試,而現在坊間有說多途徑去減化這些測試動作。這個網站羅列了數個測試方法:

7 Fresh and Simple Ways to Test Cross-Browser Compatibility | FreelanceFolder

詳細的不說了,重點就是作為 Web Developer ,對自己所製作的網站傑作,都應該執行 Cross Browser Compatibility 測試,好使自己的作品不會在某些執行環境中出洋相。

當然,在云云瀏覽器存在的世代,正如我說不同瀏覽器對網頁的呈現會有不同的演譯方法,然而強行要將一個網頁完全順利一式一樣的在各個瀏覽器呈現,並不是沒可能,只是不夠實制。比方說,對不同瀏覽器對網頁中的元作執位方面會有偏差,這個還不算太難應對。但對一些網站運用了許多視覺優化,如圓角表單、文字陰影、背景漸變等等,從前人們會用 Table、Div或背景圖來規劃一些組件來製作相關效果。但隨著 CSS 的廣泛應用,CSS版本進展到CSS3,利用它能夠將許多效果實現。這些進化了的效果在較舊的瀏覽器上當然未能完整呈現,但呈現出的結果因背後有 Backward Compatibility 的概念而也不算太強差人意。這個網站有提出一個例子解釋:

When Should You Use Progressive Enhancement

嗯,本文另一個字眼出現了:「Progressive Enhancement」。其大意是一個網頁的表現結果在各個瀏覽器都大致一樣,唯獨對新技術有所支援的瀏覽器中,會展示較好的呈現結果。以上網站顯示了一個表單資料的顯示情況。用較新的瀏覽器觀看網站,會得到較漂亮的版面,然而在較舊的瀏覽器中,亦不失其功能上的表現。當然,對於一些不明白上文所述的一切,又要要求 Web Developer 把網頁做到在任何網站一式一樣的老闆來說,那只有苦了該 Web Developer 去花心機時間做盡一切方法將其老闆的想法實現。

Pass parameter to setTimeout

setTimeout is a very general function in JavaScript which delay an execuation of a portion of code/ function call. And I used it in ActionScript as well so I was deeply get used to write the function in this format:

var param = “Hello”;

var timer = setTimeout(function(inParam){

//coding

}, 1000,  param);

Where ‘param’ is the parameter I wish to pass into the function with variable ‘inParam’ for further processing.

I didn’t realize until today I run it in IE, I got the hasty yellow exclamation mark on the left bottom status bar, saying the variable ‘inParam’ is undefined. Eventually I googled it and found that IE did a great job that she stand out from the browser keep not supporting the above syntax for passing parameter to setTimeout(). Or maybe it is too kind for other browsers to provide the above method for developer to write rapid parameter passing code.

The work around for IE to allow passing parameter to setTimeout function is:

var param = “Hello”;

var fnc = function(inParam){

//coding with the use of inParam

}

var timer = setTimeout(function(){

fnc(param);

}, 1000);

Or it is the time for me to use this complicate syntax to fit for all browsers~