Showing posts with label coding. Show all posts
Showing posts with label coding. Show all posts

Thursday, March 22, 2007

YUI-EXT - A cool tool

A friend a work linked me to this. It's a neat javascript package. It's an extension off of Yahoo! User Interface (YUI) Library. It is called yui-ext.

If you are not familiar with YUI, it "...is a javascript library that is a set of utilities and controls, written in JavaScript, for building richly interactive web applications using techniques such as DOM scripting, DHTML and AJAX. The YUI Library also includes several core CSS resources. All components in the YUI Library have been released as open source under a BSD license and are free for all uses." (Quote from http://developer.yahoo.com/yui/.)

This library takes the YUI another level. It is a bit hefty at a 345kb js file download for the users.

Monday, August 07, 2006

IE Bug Using document.getElementById()

If you are using either document.getElementById() or prototype's $() and you have an element in your page with it's name that is the same as the id of an element that comes after it, DON'T DO IT!!!

IE treats the id and name attributes of elements equally when using document.getElementById().

For an example, use the following HTML code.


<html>
<body>
name: testMe
<input type="text" name="testMe" value="First Element" /><br />
name: dontTestMe id: testMe
<input type="text" name="dontTestMe" id="testMe" value="Second Element" />
<br />
<input type="button" onclick="alert(document.getElementById('testMe').value);" value="Click me to see what happens." " />
</body>
</html>


Working Example


name: testMe


name: dontTestMe id: testMe