<?xml version="1.0" encoding="UTF-8"?>
<essay xml:lang="en" version="5.0" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:gal="http://norman.walsh.name/rdf/gallery#" xmlns:foaf="http://xmlns.com/foaf/0.1/">
<info>
    
    
    
    
    
    
    
    
<title>jQuery, .change() notification, and IE</title><biblioid class="uri">http://norman.walsh.name/2009/03/24/jQueryIE</biblioid>
<volumenum>12</volumenum>
<issuenum>7</issuenum>
<pubdate>2009-03-24T16:34:57-04:00</pubdate>
<author>
      <personname>
<firstname>Norman</firstname>
	<surname>Walsh</surname>
</personname>
    </author>
<copyright>
      <year>2009</year>
      <holder>Norman Walsh</holder>
    </copyright>
<abstract>
<para>I'd like to know when this radio button changes, ok? What's that,
you're not going to tell me when it changes exactly, you're going to tell
me the next time an event occurs? Gee, thanks.</para>
</abstract>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#Lazyweb"/>
<dc:subject rdf:resource="http://norman.walsh.name/knows/taxonomy#TheWeb"/>
</info>

<para xml:id="p1">Here's the thing. I've got some JavaScript code
that's part of an application. When the user changes a radio button, I
want to be notified so that I can change other parts of the page.
Easy, right?</para>

<programlisting>$(document).ready(function(){
    $("input[name='custom-format']:radio").change(function() {
	alert("Option changed!");
    });
});</programlisting>

<para xml:id="p2">(I'm building on top of jQuery 1.3.1; here's a full test case:
<link xlink:href="examples/ietest.zip">ietest.zip</link>.)</para>

<para xml:id="p3">That works fine in Firefox and Safari and I bet it would work fine in
Opera too. Heck, it would probably work fine in Links if JavaScript was
supported.</para>

<para xml:id="p4">On IE(7)? Not so much.</para>

<para xml:id="p5">Changing the radio button causes nothing to happen. Except that if you
click <emphasis>anywhere</emphasis> on the page <emphasis>after</emphasis> you've
changed the radio button, then you get the popup.</para>

<para xml:id="p6">Someone please tell me I'm doing something stupid. Or tell me
how to fix the stupid thing IE is doing. Or something.</para>

</essay>

