Events don't work after load content using $.get
Hi everyone,
I have an event that is not being listened and I can't figure out why.
The thing is that everything is working fine while all my html code is
static, but as soon as I modified it with some data pulled from the db, the
click() events for the radio buttons doesn't trigger the actions any more.
What I'm doing wrong?
I leave you part of the code, so you have a better understanding.
Thanks
The jquery part
--------------------
-
...
// Styles section - Effects
$("input[@name='style']").click(function(e){
$("#style_ok").show();
alert($(this).val());
// send request
$.get("view_colours.php", {style: $(this).val()},
function(xml) {
// format and output result
$("#colours > div.body").html(xml);
//alert(xml);
}
);
});
// Colours section - Effects
$("input[@name='colour']").click(function(){
$("#colour_ok").show();
});
...
the code recieved frorm the php file
--------------------------------------------
-
...
<td align="center">
images/tshirts/style_1/colour_1.jpg
<br/>
<label>
<input id="colour_0" type="radio" value="colour_1" name="colour"/>
colour_1
</label>
</td>
...
--