Firefox에서는 텍스트 필드를 선택할 때 내 커서가 나타납니다 (우분투 11.04를 사용하고 있습니다). jQuery 코드 줄이 '텍스트 커서'로 바뀝니 까?
문제
은 (커서 내가 그것을 언급하는 경우 기본 또는 포인터를 반환하기 때문에) 아래 주석 줄 것 같다 :<script type="text/javascript" >
$(function(){
var btnUpload=$('#upload');
var status=$('#logo-upload-status');
new AjaxUpload(btnUpload, {
action: '<?php bloginfo('template_directory'); ?>/upload-file.php',
name: 'uploadfile',
/* this is the problem -> onSubmit: function(file, ext){ */
if (! (ext && /^(jpg|png|jpeg|gif)$/.test(ext))){
status.text('Only JPG, PNG or GIF files are allowed');
return false;
}
status.text('Uploading...');
}
onComplete: function(file, response){
//On completion clear the status
status.text('');
//Add uploaded file to list
if(response==="success"){
$('<li></li>').appendTo('#files').html('<img src="<?php bloginfo('template_directory'); ?>/images/'+file+'" alt="" /><br />'+file).addClass('success');
$('#<?php echo $logo_image; ?>').val(file);
} else{
$('<li></li>').appendTo('#files').text(file).addClass('error');
}
}
});
});
</script>
버튼 :
<input type="button" class="background_pattern_button" id="upload" value="Choose Logo" />
어떤 제안이?
편집 : (커서가 화면에 정상 보이는 몇 가지 이유를 들어)
방화범 경위 :
귀하의 모든 JS 휴식 것입니다. 전체 방법을 주석 처리하셨습니까? – JohnP
'onComplete '앞에','가 없어도 하나의 라인을 주석 처리하면 코드가 어느 쪽이든 깨질 수 있습니다. – DarthJDG
@ JohnP 네, 문제는 전체 onSubmit 함수라고 생각합니다. – alexchenco