ajaxでリクエストを送信したのちにリダイレクト

index.pug

$.ajax({
            type: "POST",
            url: "./upload/",
            data: formData,
            processData: false,
            contentType: false,
        })
        .done(function(res){
            window.location.replace("./uploaded/");
            console.log("success");
        })
        .fail(function(res){
            console.log("falied");
        });
        

javascriptの場合スクリプトの位置からの相対パスでファイルの位置を記述できる(https://web-designer.cman.jp/other/path/)

  • ajaxでリクエストを送信したのちにリダイレクト.1622446738.txt.gz
  • 最終更新: 2021/05/31 07:38
  • by 133.11.144.10