search

Home  >  Q&A  >  body text

javascript - About modal window, close the current window and refresh the previous window

1. Click Add Data in a pop-up box (Modal) to pop up a second window (Modal). After the data is created and saved in the second window (Modal), how to refresh the data in the first MODAL? The code is as follows:


The second pop-up box will pop up after clicking Add


The code is as follows:
Pop up a new page


2. Save after adding data


3. How to refresh the first Modal data

迷茫迷茫2822 days ago647

reply all(2)I'll reply

  • 世界只因有你

    世界只因有你2017-05-19 10:18:47

    The problem has been solved, the method of calling the parent page directly in ajax.

    reply
    0
  • 迷茫

    迷茫2017-05-19 10:18:47

    Since we all use ajax, why didn’t the first Modal use ajax to process data?
    If the data in the first Modal is obtained through ajax, then after the second window is added successfully, you should execute ajax in the first window again to obtain the data again. If you use frameworks such as ng and vue, you can directly push the data added by the second Modal to the array of the first Modal. Synchronous refresh can be achieved

    reply
    0
  • Cancelreply