• Resolved ojasya

    (@ojasya)


    I have donation forms inside a Elementor popup.

    after successful donation I want the page to reload or refresh

    how can I achieve this

    thanks in advance

    • This topic was modified 3 years, 5 months ago by ojasya.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ojasya

    (@ojasya)

    I am trying this following code

    jQuery(document).ready(function(){
         jQuery( document ).on( 'elementor/popup/hide' , function (){ 
    	if (jQuery("#give-receipt")[0]){				
    	   location.reload();
    	}} );	
    });

    But since this is inside the iframe , the code is not able to detect the element with id “give-receipt”

    so I am struck here

    • This reply was modified 3 years, 5 months ago by ojasya.
    Thread Starter ojasya

    (@ojasya)

    Hey

    Ok got it working using following javascript code

    jQuery(document).ready(function(){
    	var oj=0;
    	jQuery( document ).ajaxComplete(function() {
    		if (jQuery(".give-embed-form-wrapper iframe").length>0){
    			jQuery('.give-embed-form-wrapper iframe').load(function () {
    			    setTimeout(function () {
    			        oj = jQuery('.give-embed-form-wrapper iframe').contents().find('#give-receipt').length;
    			    }, 2000);			    
    			});		    
    		}		
    	});
    	jQuery( document ).on( 'elementor/popup/hide' , function (){ 
    		if(oj){
    			location.reload();
    		}		
    	});
    });
    • This reply was modified 3 years, 5 months ago by ojasya.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Reload/Refresh current page after succeful donation’ is closed to new replies.