私はPHPファイルに取り組んでいます。私は削除を処理し、アップロードされたファイルを表示するajax jquery関数を作成しました。ときに、私はファイルを削除したいfirefoxで動作していないevent.preventdefault()関数が、クロムブラウザで正常に動作します。どのように私はこれを解決することができます。eventpreventdefault()がfirefoxで動作していませんか?
/* Read Upload Files */
function readuploadfiles(jrsid){
var jourid = jrsid;
//console.log("Journal Id: "+jourid);
//var evt = e || window.event;
//evt.preventDefault();
$.get("readuploadfiles.php", {jid: jourid}, function (data) {
//alert("Data: " + data + "\nStatus: " + status);
console.log(data);
$('#uploadfiles').html(data);
});
return false;
}
/* Delete upload file */
function deleteuploadfiles(id){
var conf = confirm("Are you sure, do you really want to delete file?");
if (conf == true) {
event.preventDefault();
$.post("deleteuploadfile.php", {id: id}, function (data) {
console.log(data);
readuploadfiles(data);
}
);
return false;
}
}
「イベント」はどこから来ていますか? – ModerateJavaScriptDev
私は理解できませんでした。 – muraliniceguy97