Reload entire page in Ajax on Django?

后端 未结 1 1720
轮回少年
轮回少年 2021-01-28 16:44

I am using ajax to go the function and check if the value already exist on the database or not. If the data already exist, I show the jQuery dialog which is working fine but if

相关标签:
1条回答
  • 2021-01-28 17:24

    You can make your answer for example json encoded, where you will return two parameters:

     { 
       success: true/false,
       data : YOUR_DATA_HERE
     }
    

    So success callback can look into success part, and decide whether to show popup with data, or make page reload

    Sorry, I don't know python, so can't advise exact expression to make correct json encode.

    0 讨论(0)
提交回复
热议问题