Archive for July, 2013

Twitter Typeahead is a fast and effective auto-complete jQuery plugin for form filling.

Twitter Typeahead 插件是一個jQuery 插件,用作快速而有效率的自動填表工具。

In desktop computer, this plugin (Twitter Typeahead) works properly. However, when this plugin is run on a mobile computer, it cannot detect the “blur” event properly. The suggested text cannot be closed when you click outside the suggestion box.

在正常的桌面電腦上,這個Twitter Typeahead插件能正常地運作。可是,一旦放在手機的瀏覽器上運行,卻因無法捕捉到“blur”的事件。如果輕觸瀏覽器的其他地方,無法可以正常關閉“提示列”。

One of the possible method is add a close button “x” to close the suggestion list. I’ve done an ugly example illustrate this: typeahead with close button “x”

其中一個可行的方法,就是在提示清單上加入一個關閉的按鈕”x”,小弟做了個核突的版本:typeahead with close button “x”

What you need to do is to change line 849:

 dropdown: '<span class="tt-dropdown-menu"></span>'


 dropdown: '<span class="tt-dropdown-menu"><a class="tt-dropdown-close" onclick="$(this).closest(\'span\').hide()">x</a></span>'

If you feel this screen is ugly, what you need is to add CSS file.


Read Full Post »

如果您在使用Google DoubleClick for publsher(DFP Ad,Google 提供的公開的點擊廣告統計)來管理您自己網站的廣告。在時發覺看不到廣告時,總想找出問題的原因。Google DoubleClick for publisher所使用的程式碼叫做Google Publisher Tag,在運行過程中,會將所發生的問題的時間、狀況記錄下來。

If you are using “Google DoubleClick for publisher” to manage your own advertisement in your website, sometimes you may want to find out the reasons behind when your ads don’t work. The library for managing “Google DoubleClick for Publisher” is called “Google Publisher Tag”. During the operation of “Google Publisher Tag”, every error will be logged into its own logging system.

要如何查看Google Publisher Tag的運行的記錄呢?它放置在googletag.getEventLog().H之內。

The “Google Publisher Tag” store the event log in googletag.getEventLog().H

用Google Chrome打開Console打入以下的指令:
Use google chrome and turn on the “Console” and enter the following command:


Google Publisher Tag Log

Read Full Post »