Online Express form reload
I was recently asked to add an Online Express donation page to my Single Page Application. It works great the first time you go to the donation view, but in all subsequent visits the form's javascript does not execute and you have to refresh/reload the site. Because this is a SPA when you leave the donation view the form is dropped from the DOM. I then use the code below to also remove the javascript file and the load function.
I used the following code in the donation view to load/reload the form
var elm = document.getElementById("EmbeddedDonationsScript");
if (elm !== null) {
var jqEl = angular.element(elm);
jqEl.remove();
if (typeof window.bboxInit === "function") {
window.bboxInit = null; // because it is still in memory
}
}
window.bboxInit = function () {
bbox.showForm(embeddedKey);
};
elm = document.createElement('script');
elm.id = "EmbeddedDonationsScript";
elm.async = true;
elm.src = embeddedURL;
document.getElementsByTagName('head')[0].appendChild(elm);
I think there is more that needs to be removed from memory before the form is reloaded. Thoughts?
I used the following code in the donation view to load/reload the form
var elm = document.getElementById("EmbeddedDonationsScript");
if (elm !== null) {
var jqEl = angular.element(elm);
jqEl.remove();
if (typeof window.bboxInit === "function") {
window.bboxInit = null; // because it is still in memory
}
}
window.bboxInit = function () {
bbox.showForm(embeddedKey);
};
elm = document.createElement('script');
elm.id = "EmbeddedDonationsScript";
elm.async = true;
elm.src = embeddedURL;
document.getElementsByTagName('head')[0].appendChild(elm);
I think there is more that needs to be removed from memory before the form is reloaded. Thoughts?
Tagged:
0
Categories
- All Categories
- 6 Blackbaud Community Help
- 211 bbcon®
- 1.4K Blackbaud Altru®
- 396 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 360 Blackbaud eTapestry®
- 2.5K Blackbaud Financial Edge NXT®
- 650 Blackbaud Grantmaking™
- 568 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 937 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.5K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 248 ResearchPoint™
- 119 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 239 The Tap (Just for Fun)
- 34 Blackbaud Community Challenges
- 31 PowerUp Challenges
- 3 (Open) PowerUp Challenge: Data Health
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 785 Community News
- 2.9K Jobs Board
- 53 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
