the coding room

a place for coder talks

IE bug?

I don’t know about you folks, but I have a little function I call to get an element by its id and it goes something like this

function getObj( pID ) {
    if( util.docRoot.getElementById )
    {
        return util.docRoot.getElementById( pID );
    }
    else if( util.docRoot.all )
    {
        return util.docRoot.all[pID];
    }

    return false;
}

For example, we have two <input> fields as such

<input type=”text” id=”shakeit” name=”shakethis” value=”valueA” />

<input type=”text” id=”shakethis” value=”valueB” />

Well, in Firefox, when I do

var someElement = getObj( ’someID’ );

the someElement contains the element with ID equal to “shakethis”, as expected.
In Internet Explorer though, someElement contains the first occurence of “shakethis”
even if it matches the name of the <input>.

Which, in the above example, means that if we were to print someElement.value this would be equal to “valueB” in Firefox
and “valueA” in IE.

Weird bug or just me being totally ignorant??

Or, as someone would say, is it a bug or a feature??

Posted in HTML, Web Development, Javascript | No Comments »

A pop-up on mouseover with Ajax

I was working till seven o’clock yesterday trying to see why the floating box I had created two weeks ago sometimes would not give up and disappear.

The story behind this project

The project is an online jewellery catalog, although you can think of it as an image gallery for simplicity. The goal is to show a pop-up bubble box, when the mouse is over an image, with extra information about that particular product.
Read the rest of this entry »

Posted in Web 2.0, Web Development, Javascript, Ajax | No Comments »

First post…

…is always a charm. Here is mine. This, hopefully, will be a place for discussion. I intend to update the blog with bug discoveries concerning Internet Explorer and web development in general. And more, whatever comes to mind actually.

Posted in Blogroll, Uncategorized | No Comments »