Sunday, August 31, 2014

Turn PHP Output Buffer Off to Make it Live on IIS

Questions will be raised on why we need such a trivial feature on our machines? The answer is simple, we want to turn our browser into a server console. When we deal with a extremely large database and we use PHP to process it, we really need the live update on the browser to see the progress as it may take a few hours to complete. Especially when it comes to debugging the PHP during the MySQL processing,...
Read More »

Tuesday, August 19, 2014

Drawing Line Using Javascript (with Anti-alias Smoothening)

Caveat: It will not look good if the line is steep. Extra work is required to fix this script to render good steep lines. This is my in-house recipe for anti-alias smoothening of line drawing using Javascript. It is not perfect and it is mainly for educational purposes. It might not be suitable for commercial web sites. If you don't want the anti-alias feature, you can try my plain line drawing...
Read More »

Drawing Line Using Javascript

Updated on 27th of August: Please use the 2nd version of my drawLine() function (scroll to the bottom of this page) if possible. The first version has a lots of flaws which may not draw the line correctly in certain situation. With HTML5 coming hot and jQuery to be well received by web developers, Javascript is now a frozen cake from the fridge. Especially when it comes to drawing shapes on browsers,...
Read More »

Friday, August 15, 2014

Javascript to Prevent Selecting Texts on Tabled Buttons

It is now a common phenomenon that HTML tables are made buttons to replace conventional image-based buttons. The benefits of tabled buttons are quick loading, good button quality when zoomed on tablets and easy to change color. There is also no need to perform pre-loading. This new popular method of displaying buttons can sometimes perform awkwardly if the text selection is not turned off on the...
Read More »

Thursday, August 14, 2014

How to Quickly Identify Missing/Extra HTML Tag

When your HTML gets more and more complicated and packed, a slight mistake in the tagging will render you helpless. It could take a long time to find just a missing or extra tag. My way of solving this problem is to use Notepad++! It's free but it is only available on Windows. It's easy. You just need to click on the tag and look for missing PURPLE! Once you click on any of the HTML tag, the corresponding...
Read More »

Thursday, August 7, 2014

Javascript to Measure Vertical Scrollbar Width

I used the following codes to measure the vertical scrollbar (overflowY) width so that I can place a dummy blank DIV onto the real scrollbar to prevent someone from scrolling by dragging the scroller on the right scrollbar. <script> var dummyDiv = document.createElement("div"); // Create a dummy DIV dummyDiv.style.overflow = "scroll"; // force it to have a scrollbar dummyDiv.style.width = "50px"; // required for IE, can be other values document.body.appendChild(dummyDiv);...
Read More »