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~

Move from PHP to JSP, the starting point of learning thing in all new

It has been around 8 years I work with PHP + MySQL, with additional technique like ActionScript 2.0/3.0 and Flex, jQuery, Ajax to enhance the front-end design, I start exploring a new era in my life recently, the JSP and related knowledges.

When talking JSP, JAVA is involved as well. I didn’t learn JAVA with a complete course, so does JSP. At first I think ‘they are just programming language, it shouldn’t be hard to master it as long as it is Object-Oriented Programming language. But the more I read about JSP/JAVA, the more unclearness I encountered, and it really a tough stuff to master, especially there are many new concepts that are different from PHP or MC++.

The first step to master JAVA/JSP is to setup an environment for running your test script/sample script. Setting ‘JAVA_HOME’ is not difficult, but for some package code, it is far from easy to make the stuffs work finally. ‘Servlet, JavaBean’ those are new idea to me. Server like Tomcat/jBoss keep surrounding my mind without figuring them out clearly. It makes me more agree with that, despite the scalability of JAVA is far stronger than PHP, PHP make rich internet application development much easier.

I am still on the path of learning JAVA, JSP, Servlet. Hope to see anyone who skillful in PHP can provide easier way in mastering JSP.

What should a Front End Web Developer be?

Previouly I was a guy being called as Interactive Developer, help previous boss making his cool stuffs from concept into similar real visualization, no matter using ActionScript 3 to write Flash or using jQuery to write XHTML. Now come to a new job titled as Front End Web Developer, I try to look deeper in what the role should a Front End Web Developer be.
Continue reading What should a Front End Web Developer be?

An evolution of Gordon Chan

How often do you concern about your name or brand nam ethat you own? Have you ever check your name in some search engine so as to know who call the same?

Just a search with a keyword “Gordon Chan”, a name that followed me at least 15 years from my primary school, is not that simple:

  • Gordon Chan is a famious Hong Kong film director, 陳嘉上
  • Gordon Chan is a real estate agent in Canada
  • Gordon Chan is an academic staff/doctor/PhD belong to the department of oncology in the University of Alberta in Canada
  • Gordon Chan is the Principal of FCGA in Canada
  • Gordon Chan is also an artistic hair designer, etc.

Wow, and now, I would like to introduce myself into the world of Gordon Chan:
Gordon Chan is a Web Developer who keen on exploring the possibility of web authoring with passion on making the world of website to be better suit for various clients and visitors’ need.

For the last 12 years, I start building website using FrontPage Express, FrontPage, and later on using Adobe Dreamweaver, or even just Notepad2 for web authoring, I can see how the world of web development change. I cannot say I can bring any new technology advance, I can at least make use of new techniques with standard code style so as to make good works and let visitors to have fun in my works. And now it comes to the time that I start using my name as the brand for my works, and hope in the up-coming future people will know more about me, not a film director/doctor/agent or designer, but a specialist, web developer.

Welcome to GC Log

Keep opening and closing numerious blog, starting from today, with lots of work done just for rebuilding the status of mine in the Internet. GC Log, the log of Gordon Chan, I wish to keep my sharing, my learning and knowledge here. I will try to post back some useful blog that I wrote in the past.

Currently besides this new blog, I have 2 ancient blogs that did not update for long time but they worth to be kept forever providing some necessary information:

Gordon @ Kr : http://kr.snap-ustar.net
T-Log : http://snap-ustar.net/blog/
(I disconnect my snap-ustar.net / snap-f.net domain, from now on, gordon-chan.net )

And please don’t forget my personal webpage: http://gordon-chan.net

You may access my personal webpage through http://gordon-chan.info and http://snap-ustar.net