last day (32 days later) » 

Lix
8:09 PM
Ahoy
 
Haha, good thinking. Probably shouldn't clutter that tavern with my jQuery ineptitude,
 
Lix
Paste ye HTML in this textbox...arggg....
:P hehe - yea... well.. its quiet now :P
but then they gonna see 300 new messages in that tab and see our chatter ;)
 
Haha, right.
 
Lix
So lets see your HTML
 
Sure, just a sec
<H3>Image One</H3>
<DIV class=variable-valuesimage sizcache="1" sizset="25"><INPUT id=Variables_3__Name name=Variables[3].Name value="Image One" type=hidden> <INPUT id=Variables_3__Id name=Variables[3].Id value=207 type=hidden>
<DIV class=cover-variable-radio sizcache="0" sizset="25"><INPUT id=vb207-0 class=cover-radio name=Variables[3].Value value=V-EVO-792-EN/SS4286329.jpg CHECKED type=radio jQuery15107223420276045673="60"> <LABEL for=vb207-0 sizcache="0" sizset="25"><IMG class=selected alt="" src="http://localhost/templates/covers/V-EVO-792-EN/SS4286329_thumb.jpg" jQuery15107223420276045
Ick, wow.
 
Lix
8:14 PM
its cool - i'll take it into vim
mmm - ok so that actual problem is that it doesnt work on ie7
 
Correct.
The line image.addClass("selected").closest("input:radio").attr("checked", true); is inside the image's click event handler.
in IE 9, that line causes the radio buttons "change" handler to fire.
 
Lix
no no no no no no now wait a second :P
How did u put normal text and code blocks on one line?
 
Hahahaha
 
Lix
It just doesn't
`Work for me``
screw you!!! :P hahaha
 
On one line, you can use backticks =)
for code.
 
Lix
8:18 PM
I tried that
obviously not....
 
lol
 
Lix
fuck... ok - but on multilines
that `doesn't` work...
 
Riiight =)
 
Lix
ok ok ok ok :P sorry :P had to get that out :P
dont deal with much code in meta chat :P
 
Ok, so here's a more complete scoop. I have this click event handler for images:
$(".variable-valuesimage .cover-variable-radio img").click(function () {
    var image = $(this);
    $(".cover-variable-radio img.selected", image.closest(".variable-valuesimage")).removeClass("selected");
    image.addClass("selected").closest("input:radio").attr("checked", true);
});
 
Lix
8:20 PM
ok I think I know what the problem is...
 
That works. Then, in IE9, the last line causes the radio button change event to fire:
$(".cover-radio").change(function () {
ShowDependsOn($(this));
});
 
Lix
the .closest() function actually goes one level up the DOM tree
 
Oh, ok.
 
Lix
Maybe .prev() would be better suited...
try using that to select the inputs...
image.addClass("selected").prev("input:radio").attr("checked", true);
 
Alright, just a sec.
 
Lix
8:23 PM
WOW - I really hope there are a BUNCH of feature request posts for chat to improve this....
Kind of hard to give technical support with such a limited tools...
 
Hmmm, that isn't working either. I may be looking in the wrong spot for the problem. This might actually warrant a post on stack overflow.
I think I need to work through the problem, so that I can at least present it a bit more clearly.
So if this is my structure (around the image):
 
Lix
well why dont u try this first - throw a bunch of alerts for different selectors and see what comes back...
 
<DIV class=cover-variable-radio sizcache="0" sizset="26">
	<INPUT id=vb207-1 class=cover-radio name=Variables[3].Value value=V-EVO-792-EN/CCA202.jpg type=radio jQuery15107223420276045673="61">
	<LABEL for=vb207-1 sizcache="0" sizset="26">
		<IMG alt="" src="http://localhost/templates/covers/V-EVO-792-EN/CCA202_thumb.jpg" jQuery15107223420276045673="41">
	</LABEL>
</DIV>
 
Lix
you can put arbitrary values in a REL attribute and alert them out - debugging those IE's is a pain in the ass...
 
Right on, I'll give that a shot.
 
Lix
8:29 PM
oh wait...
is that the same code u sent me?
 
Yes. Maybe. Yes.
It's an image, inside a label, right after the input.
Which is all wrapped in a div.
So would I need .prev twice?
 
Lix
yea yea - i didnt see that earlier....
you should do this -
image.addClass("selected").parent().prev("input:radio").attr("checked", true);
yea sorry about that - I was a bit thrown by your HTML tags being all capitals :P
not used to seeing that
 
Yeah, I know. Me neither =) It's a big MVC project I just inherited. Some of the practices are a bit...odd.
Oh wow, that worked!
 
Lix
nice :P
 
I've got to run these tests through a few other browsers now, but I think that did it.
Thanks a bunch man! You're awesome.
 
Lix
8:40 PM
@jad - Wow - that was strange :P Sorry about that - the power cut out the instant I pressed enter :P
And you are very welcome man :P
jQuery 1 - IE 0
 
@Lix Haha, yes! jQuery > IE.
This client side stuff is going to be the death of me.
=)
 
Lix
naa its great man :P
u using chrome?
 
@Lix Yep.
 
Lix
so the chrome dev tools are the BEST for debugging and playing around....
then you can get a jquery injector extention and you can just screw around on the fly and debug stuff really easily...
 
@Lix Yes, I've been loving that part. I like being able to see all the async POST and GET calls
 
Lix
8:46 PM
get this - you can put breakpoints on DOM elements... the breakpoint is triggered when the HTML is altered....
yea - that too - but when u working in facebook there is ALOT of noise happening there - in the sense of ajax calls :P
its hard to see mine through all that mess :P
and now tell me this - how are you with watching long youtbe google tech-talks? :P
 
@Lix Oh, wow that's awesome.
 
Lix
damn it... the video i wanted to send u was taken down!
 
@Lix Haha, I have not tried it. Why, are there some good ones for client programming?
 
Lix
and it was on their official channel too! :P bastards :P
 
Oh, well shoot.
 
Lix
8:55 PM
but look it up man.. search for tuts on the chrome developers tools... amazing stuff....
I gotta run man - i'm sure i'l see you around!
 
Later man, thanks again!
 

  last day (32 days later) »