Sunday, April 26, 2009

Finally found a bug in IE

Last week I was stuck with javascript issue in IE. I have list of elements in a form and I want to access one of them by their name. In FF its works but in IE it doesn't work for me. It screwed me for an hour but finally I got the reason for the problem.

Let’s say I have an input box with name "1_txt" and a button with name "btn". When click the button it calls a function that will put a "Welcome!" message in the textbox. It works in FF. But in IE it changed the value of the button to "Welcome!" instead of the textbox.

Reason for the problem here is when we give element name start with number (1, 2, 3...) and followed by underscore ("_") and then alphanumeric. IE split the element name by underscore like 1+’_’+"txt". So it gets 1 as an index in the elements array. That’s why it updating the button (second item in the element array i.e., index is 1) element.


Eg:


<html>

<head>

<script language="javascript">

function showMessage()

{

document.forms["frm"].elements["1_txt"].value = "Welcome!";

}

</script>

</head>

<body>

<form name="frm">

<input type="text" name="1_txt" size="20" />

<input type="button" name="btn" value="Click" onclick="showMessage();" />

</form>

</body>

</html>

Tuesday, April 14, 2009

Trend in blogging Vs Tamil literatures

Blog consists of large content or even a page or story. It is a kind of short story or incident or event, sometimes it’s good to read the interesting blog when we have the enough time to do so or even we can create one like I did. But the point here is, we get more details about the topic because we have the ability to create a blog with large content. Only disadvantage I personally feel is readers are so lazy to read large blog.

We have so many Tamil literatures like cilapathikaram, manimekalai, ramayanam, mahabharatham, etc... These above literatures consist of several paragraphs. Each paragraph in most of these literatures is song. Below is a paragraph from cilapathikaram.

அரசியல் பிழைத்தோர்க் கறங்கூற்றாவதூஉம்
உரைசால் பத்தினிக் குயர்ந்தோ ரேத்தலும்
ஊழ்வினை யுருத்துவந் தூட்டும் என்பதூஉம்
சூழ்வினைச் சிலம்பு காரண மாகச்
சிலப்பதி காரம் என்னும் பெயரால்.


Same disadvantage arise here. People who have interested and leisure time can get benefits by reading these stories.

Early 2006, we have every much experienced with micro blogging. When I thought about how micro blogging got this much of wider audience. I found that it’s very easy to create and read a micro blogging. Most popular micro blogging site is Twitter. We have maximum of 140 characters to create a micro blog in Twitter.

Thirukural, is one of the best literature in Tamil and it’s also translated in many other languages. It just contains two lines. First line contains four words and second line contains three words. Below is one of the Thirukural.

அகர முதல எழுத்தெல்லாம் ஆதி
பகவன் முதற்றே உலகு.


Now micro blogging further reduced by the flutter. It’s the new micro blogging site. We have maximum of 26 characters to create a micro blog in flutter.

Athichudi, is written by very famous women Tamil poet Auvvaiyar . It’s in single line. Normally contains two or three words. Below is one of the Athichudi.

அறம் செய விரும்பு.