Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Javascript] To DOM or not -- calendar popup


  • From: mwarden at gmail.com (Matt Warden)
  • Subject: [Javascript] To DOM or not -- calendar popup
  • Date: Wed Mar 29 13:44:00 2006

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bill Moseley wrote:
> 2) or in the script search for the input field and then append the
> <img>  to the field's parent node list?[1]
> 
> Seems like 2 is the "correct" way to go, but seems like a bit more
> work.

It's not that bad. Something like:

if (document.getElementById && document.createElement) {
	var field = document.getElementById('whatever');
	if (field) {
		var img = document.createElement('img');
		img.src = 'whatever.foo';
		img.onclick = calPopupFunction;
		field.parentNode.appendChild(img);
	}
}


- --
Matt Warden
Miami University
Oxford, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFEKuNerI3LObhzHRMRAgv5AJ0Vz4QjZMgtG8sFAW7NoUpJx8dZ4QCgvlCL
vbV4MibAi1GC3Ii3atT6JVE=
=kpz9
-----END PGP SIGNATURE-----