I'm having a bit of an issue with IE8 and jQuery 1.9.1.
The target browser is IE8. I get an undefined variable when I try to alert the rolevalue var.
Here's the code:
function get_role(){
var test = document.getElementsByName("admin_role");
for(var elem in test){
if(test[elem].checked){
var rolevalue = test[elem].value;
$.post('<?php echo base_url(); ?>ajaxsc/getrole/',{role:rolevalue},function(result){
$('#roletest').html(result);
});
}
}
**alert('role = ' + rolevalue);**
return rolevalue;
}
forloop rather thanfor..infor array-like collections. You may be getting more properties forelemthan you expect. stackoverflow.com/questions/500504/…