I can pass 'this' but using ("#"+this.id) was the way to do it with the
least code written. Inside the function I need to check the first 4 letters
of the ID string of the calling element to determine how to proceed, as well
as use the id as an element reference for the jQuery object. So it's either
pass that or use 'this' and inside the function:
checkid = $(id).attr("id").substring(0,4)
and then use checkid in comparisons. But I thought creating the extra object
inside the function to carry this was wasteful.
Since passing the concated '#id' string works without further modification
inside the function it seemed like the best way to go about it. I'm not a
particularly skilled JS developer though, so perhaps the best practice is to
keep shenanigans like that inside the function? If it's hackish perhaps I'll
find it doesn't always work in the future.
Cheers
Miles
On 1/14/07, Ⓙⓐⓚⓔ <[EMAIL PROTECTED]> wrote:
a bit clunky! just pass in this! and let checkState do the dirty
work... if it is actually needed!
--
Ⓙⓐⓚⓔ - יעקב ʝǡǩȩ ᎫᎪᏦᎬ
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/