Mar 2, 2012

How to include JavaScript file in another JavaScript file

0 poops
To do this you need to use the following function:

// this function includes all necessary js files for the application
// One shortcoming about this include method is that the included js file functions cannot be loaded on page load (Only after the form is done loading only can be used)

function include(file) {

var script = document.createElement('script');

script.src = file;

script.type = 'text/javascript';

script.defer = true;

document.getElementsByTagName('head').item(0).appendChild(script);

}


/* include any related js files here, sequence is important */

include('/img/_customjscripts/ZNVDR_KRFormValidate.js');
Remember that only the first level (the main JS file) will be loaded, any call to included JS file cannot be performed until your page is finished loading.

Feb 21, 2012

Could not load file or assembly vjslib.dll

0 poops

I had some problem trying to build my solutions (the source code is provided by vendor) in 64-bit VS environment and did some Google search gave me this result:

http://social.msdn.microsoft.com/Forums/da-DK/netfx64bit/thread/71698a63-c90a-4aa2-b90e-4a87ff8a4524

Dec 7, 2011

Time to learn

0 poops
I have always been someone who likes to act on impulse, and think later.

It has a fair share of pros and cons to it: for one, I will always get what I want most of the time. But on the other end, I might not have enough time to consider will my action affect other persons or outcomes.

Is it really much better or wiser to think through all the possibilities first before acting on something? Love, work, family, the deceiving environment that we faces everyday, does this means that everything in life needs to be considered?

I don't wish to change myself, but I'll try to look at it from the other perspective, and see how much differences it makes in my life.

Nov 30, 2011

MIA

2 poops
Sorry I have been not blogging for so long, after all this is more like my personal journal then something that I blog everyday to generate ad revenue.

Alot of things happened, I'm now working in Singapore, I got into some awesome company, and I also had a messed up relationship. I still feel sad and down for abit now, but that's something everyone has to go through no matter what.

At least I saw my own problem and weakness which I would definitely need to change and improve on. But for the time being, I need more soul searching I think.

Aug 4, 2011

SC2

0 poops
Todo: Learning to scout better and read what the opponent is trying to do.

I still have much to learn since I can only scout for 2 gas fast tech, or 6 pool, or 4 gate aggro, or Forge (still miss this sometimes)

Jul 30, 2011

Went to China

Location: Yichang, Hubei, China 0 poops
... and came back sick, the 37 degree Celsius weather is freaking hot and killing me.

Jul 11, 2011

Don't hate, but love

0 poops
I've been following the news as closely as I could. On the first sight of all the civilians being "attacked" by polices, I was really pissed as the attack was unjustified!

But after thinking through for awhile, and reading one article here, I nearly cried. (Yes, nearly, I don't hide my emotions like some hypocrites)

So my message is simple to all of the people who supports Bersih 2.0 out there:

Bersih 2.0 is not meant to incite the anger between Malaysians! Please remember it is to bear a clean and fair election so we can have a better future! Stop getting angry because of what FRU did, they are also only following orders from some shit on top! Remember, the sweet vengeance comes next election!

One love from Malaysian working in Singapore!

Jun 25, 2011

Bad web design

0 poops
I don't usually comment on some bad web design, but this particular website really makes me feels sad. I feels that I must point out the idea of it allowing animated images for each seller is really bad.

Too much animated images, and your audience won't know where to start.

May 28, 2011

Moving

0 poops
Yeah I'm moving out from my sister and bro-in law's house later.

First thing to do? BUY A NEW PC!

Will post some photos of my new PC when I am setting it up.

Ciao.

May 10, 2011

JavaScript with asp.net, no runat="server" please

0 poops
I had this JS in my application.

Please replace all the [ ] with < > tag because HTML tag is being rendered in this post. =.=


[script language="javascript" type="text/javascript"]
        function toggle(flg) {
            var el = document.getElementById("rowCustomer");
            if (flg) {
                el.style.display = '';
            } else {
                el.style.display = 'none';
            }
        }  
[/script]

[tr id="rowCustomer" runat="server" style="display:none;"]
    [td]
        Customer
    [/td]
[/tr]

Just realized that you can't have runat="server" with Javascript hide/show visibility or the document.getElementById will not be able to get the row.