[thelist] AJAX Tip
Matt Warden
mwarden at gmail.com
Thu Apr 6 06:42:52 CDT 2006
On 4/6/06, Lee kowalkowski <lee.kowalkowski at googlemail.com> wrote:
> > How do you NOT use the DOM when you want to do unobtrusive Scripting?
> > Even if it is DOM-1?
>
>
> Hmm, let's see...
>
> <a href="picture.jpg" onclick="return showPicture(this, 'picture.jpg');"><img
> src="thumbnail.jpg" /></a>
That is the part that is not unobtrusive. There should not be JS in
the markup. I think this is where Christian is confused, because
typically you'd do:
var foo = document.getElementById('...');
if (foo) foo.onclick = function() { showPicture('picture.jpg'); };
--
Matt Warden
Miami University
Oxford, OH, USA
http://mattwarden.com
This email proudly and graciously contributes to entropy.
More information about the thelist
mailing list