Wednesday, January 19, 2011

Excel column label calculation (increment)

Sharing out the code that calculate the excel column label by increment. Suitable for any version of excel.

Sunday, January 16, 2011

IE8 : jquery : ajaxfileupload : Syntax Error: Unterminated string constant

The problem
Write a web app to upload a file, read the content then return the content in HTML table using JSON format then display the result dynamically at current HTML page. Below is the JSON return by a PHP script.
{filename: 'input.dat',total_recipient: '1',totalcolumn: '3',samples: '<table width="400px"><thead><tr><th>Column 1</th><th>Column 2</th><th>Column 3</th></tr></thead><tbody><tr><td>name</td><td>phone no</td><td>address</td></tr></tbody></table>',columntag: '{Col_1},{Col_2},{Col_3},'}
As usual it work perfectly on FF 3.5.3, but when come to IE8 I got the error message "Syntax Error: Unterminated string constant".

Saturday, January 15, 2011

IE8 : Object doesn't support this property or method

The problem
Try to load following html to IE8 then insert some text to the input box and click the button. It should just alert the text you had key in but it give a javascript error "Object doesn't support this property or method". Below code work perferly on FF 3.5.3.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>ID Test</TITLE>
<script type="text/javascript">
function testnow()
{
 inputvalue = document.getElementById('inputvalue').value;
 alert ("input value is ["+inputvalue+"]");
}
</script></HEAD>
<BODY>

<H3>Input Text</H3>
<input id="inputvalue" type="tet"></input>
<BR/>
<button onclick="testnow()">click me</button>
</BODY></HTML>