2012-11-19 2 views
0

저는 JQuery를 처음 사용했습니다. ... 나는 파일 크기에 오류가 발생했습니다 때문에다른 함수에서 JQuery 값 가져 오기

$(document).ready(function() { 
    $('#pics').bind('change', function() { 
     filesize = this.files[0].size; //Value of this one 
     alert(filesize); 
    }); 

    $('#Frm001').ajaxForm(function() { 
     $('span.save-notice').text('Save Changed Successfully'+filesize); //to this one 
      $('span.save-notice').show(); 
     }); 
}); 

가 어떻게 실제로 ajaxFormFunction에 기능 위에서 값 파일 크기를받을 수 있나요 : 그리고 다음 코드 있나요?

고마워요.

+0

'change' 이벤트가 완료되기 전에 ajaxForm이 나타나면 어떻게해야합니까? –

+0

변경 기능에 ajaxForm을 삽입해야합니다. – Luka

답변

0

내가 원하는 것 같습니다. 변경시 ajaxForm을 실행하십시오.

$(document).ready(function() { 
    $('#pics').bind('change', function() { 
     filesize = this.files[0].size; //Value of this one 
     alert(filesize); 

     $('#Frm001').ajaxForm(function() { 
      $('span.save-notice').text('Save Changed Successfully'+filesize); //to this one 
       $('span.save-notice').show(); 
     }); 
    }); 
}); 
관련 문제