Wednesday, October 13, 2010

JavaScript: passing undefined number of arguments to a function

This is just for my own reference. Most of the time, I forget things that I have discovered. To keep track of everything, I decided to blog it instead, which is not a bad idea, right?

The question is how I can pass an undefined number of arguments to a function in Javascript. After googling for hours, I've finally gathered some enough information and have done some tests. Here are the 4 huge lines of efforts. :P

function eatanything(args)
{
alert(arguments.length);
}
eatanything('hello','to','myself');
Google has all the answers you are seeking for. It is just a matter of giving a spot on keyword(s) to get the perfect answer. Yahoo! Answer is also a good option.

Firefox stop Adobe Flash plug-in during debug mode

Mozilla Firefox has been my favorite browser to debug my Adobe Flash application for years. Ever since, the rolling out of the new feature from Mozilla Firefox, which will prevent crashing Adobe Flash plug-in causes the whole application to crash.

1. Open up Mozilla Firefox
2. Type about:config in the navigation URL . You will see:
3. Proceed by clicking on the I'll be careful, I promise!, then filter by ipc
4. Makesure that dom.ipc.plugins.enabled.npswf32.dll is being set to false

Shut down your Mozilla Firefox and you should be ready to debug.

Here is where I find the answer: