I am sorry for this post, But i do not understand why my code is not working. I have table with checkbox in every row and top of table a edit button. I want to select a row and want to edit by clicking edit button. Please see my code in else condition. I have tried window.location , window.location.replace, window.location.href but nothing working. Please help.
$('#lc_edit_btn').click(function(){
var countchecked = $('table input[type="checkbox"]').filter(":checked").length;
if(countchecked<1){
alert('You didn\'t select any item.');
}else if(countchecked>1){
alert('You can can not edit more than one item at a time.');
}else{
window.location = "http://<?php echo base_url();?>lc/edit";
// similar behavior as an HTTP redirect
window.location.replace("http://<?php echo base_url();?>lc/edit");
// similar behavior as clicking on a link
window.location.href = "http://<?php echo base_url();?>lc/edit";
}
});