document.write causing blank page

Recently my company website has a 3rd-party site traffic tracking code blocking the site from rendering. The download of that JavaScript file never end until gateway timeout, hindering the site from complete loading.

I tried to make the JavaScript to be downloaded async so as to avoid the blocking issue, sadly it turns out a blank page.

Drill down to the root clause of the blank page issue, I find that it is caused by a document.write statement in the downloaded code. And find out that: document.write can only be used for inline,when the code is downloaded async, document.write will simply create a blank document and write the content on it.

To avoid it, we need to overwrite the document.write function to fit with the change. Detail can be found from the site:
https://github.com/eligrey/async-document-write

城市獵人‧시티헌터‧City Hunter

城市獵人‧시티헌터‧City Hunter ,這是近期看過最引人入勝的韓劇。相逢恨晚,這是2011的片子我到2012年才翻看。由起始的行刺恐怖事件一度以為這是講述南北韓分裂的故事,卻又峰迴路轉說的是一些黑暗的政治情況,引致主人公落入報仇的人生。又以為故事一直看下去是一些滿佈暴力的服仇行動,縱然是,卻充滿對光明社會的憧憬,厭棄一命換一命的方式為陳年的事報伏,改以由社會由法律去制裁那些惡傢伙。

Continue reading 城市獵人‧시티헌터‧City Hunter

Happy New Year @ 2012

Happy New Year @ 2012

It is a difficult year, no matter to the world or to me. There are too many disasters, the financial crisis, making lots of people die or poor. And for my job, we finally make out company site launch. We got too many to work out in order to meet numerous deadline: Launch date, pre-sale, etc. But no matter what, this 2012 I am preparing for my new era. I hope to work our our future with my love. And I wish I can share my skills to help more people to work out more great sites.

Wish you all best in 2012!

Hint about: java.security.AccessControlException: access denied (java.net.SocketPermission host connect,resolve)

I am not Java Applet expert, but I found this worth for sharing.

I was told by my boss to check for the resolved ip for CDN domain. As I know, the resolved ip for a CDN domain is vary from geographic to geographic.It does not work to place the detection code on a particular server. Continue reading Hint about: java.security.AccessControlException: access denied (java.net.SocketPermission host connect,resolve)

CodeIgniter 2.0 video tutorials by Big Name

With the famous PHP framework CodeIgniter upgraded into 2.0, I make use of this occasion to refresh my knowledge on this such great tool. Having an afternoon to surf in Google, I find a genius CI programmer kindly sharing his knowledge of writing some basic CI 2.0 tutorials, using the admin, blog, authentication scenario as demonstration. It really worth for people who wish to strength their PHP skill and programming logic like password validation, system flow.

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.