How To Refresh Greybox Parent Page
I wonder why its hard to find this tutorial on the web. So I decided to make my own. This snippet is useful if you’re editing data in the greybox pop up window and then you want to reflect the changes in its parent window by refreshing it.
In case you want to test this code instantly, you may download the code or see the result of this tutorial live:
Step 1: Download Greybox here and place it inside you js/ directory.
Step 2: Create your index.php file, with these codes inside:
Step 3: Create your greybox pop up page which is greybox_pop_up.php with these codes inside:
Step 4: You should have this files by now:
Step 5: Testing
- If you’re gonna run index.php, you should see this in your browser:
- Change the predefined textbox value to any values you want, like the following:
- Click the link to show the greybox pop up
- Close the pop up window, if the textbox value returned to “some predefined value”, it means that the parent page was refreshed.
By the way, if you’re not yet familiar with greybox, I also have a tutorial on how to use greybox. That’s it! Hope it helps :)