search

Home  >  Q&A  >  body text

javascript - Questions about product deletion?

The problem is: Use confirm to make conditional judgments. If you click to cancel the deletion and refresh the page, the product type that has just been deleted will be deleted (normally it will not be deleted if you cancel the deletion). What is going on? ?

仅有的幸福仅有的幸福2779 days ago939

reply all(3)I'll reply

  • 習慣沉默

    習慣沉默2017-06-12 09:32:16

    Post the code and take a look. If you click confirm, it will return a value of true, and if you cancel, it will return false. Is your logic probably as follows?

    if(confirm()){
        //删除
    }
    //隐藏弹框
    

    reply
    0
  • 学习ing

    学习ing2017-06-12 09:32:16

    This question is very simple. You can specify the specified process after "confirm" or "cancel or close" for any confirm or third-party confirm. If there is a problem with the logic you wrote, please post the code

    reply
    0
  • 世界只因有你

    世界只因有你2017-06-12 09:32:16

    The logic of cancellation and confirmation is reversed, right?

    reply
    0
  • Cancelreply