2014-01-29 3 views
0

이 게시물에 대해 유감이지만 내 코드가 작동하지 않는 이유를 모르겠습니다. 나는 모든 행에있는 체크 박스와 테이블의 편집 버튼이있는 테이블을 가지고있다. 행을 선택하고 편집 버튼을 클릭하여 편집하고 싶습니다. 다른 조건으로 내 코드를 참조하십시오. 내가 시도한 window.location, window.location.replace, window.location.href하지만 아무것도 작동하지 않습니다. 도와주세요.자바 스크립트의 리디렉션 페이지

$('#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"; 
       } 
     }); 
+0

이 당신의 다른 여부에오고 있는지 확인합니다. http : // lc/edit –

+0

'console.log ("http : // lc/edit"); 브라우저 콘솔을 확인하십시오 !!!!!!! – rynhe

+0

아마 http://stackoverflow.com/questions/503093/how-can-i-make-a-redirect-page-in-jquery-javascript – Syd

답변

0

이 시도 : 크로스

window.location = "http://" + <?php echo base_url();?> + "lc/edit"; 
관련 문제