Harinder Harinder - 6 months ago 37
Javascript Question

JavaScript uk-modal-close and reload page

Hi i am using http://getuikit.com/docs/modal.html on my site,

my code as below

<a href="#my_modal" class="uk-button" data-uk-modal="">Click to open modal</a>
<div id="my_modal" class="uk-modal">
<div class="uk-modal-dialog">
<a href="" class="uk-modal-close uk-close"></a>
<p>...body ...</p>
<div class="uk-modal-footer">
<a href="#" class="uk-button uk-modal-close" id="openmodal">Cancel</a> <!-- Just close the modal -->
<!-- Call external link -->

i want to refresh background when some one click Cancel, i am noob in js but done some research and found


this will help in reload page but don't know how can i use it, can any one help


As per the documentation here, you may use the hide.uk.modal event, which is trigged whenever the modal is closed. In the event handler, you can use the reload functionality. Include jQuery file as well.

    'hide.uk.modal': function(){