0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

axiosでリロードできなかったつまずき

Posted at

現象

初め下のコードを書いていたところ、200が返ってきているにも関わらず、ページがリロードされない現象に悩まされました。

axios.get('/user')
  .then(location.reload())
  .catch(error => alert("失敗しました。"));

解決

結論、javascriptの書き方が違っていたようです。

axios.get('/user')
  .then(res => location.reload())
  .catch(error => alert("失敗しました。"));
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?