Trigger Pop Up Based on URL
-
I have a site that redirect the users to a page after submitting a form. It redirects to example.com/page/?submission=success.
I have the following code to trigger my popup:
<script> var getUrlParameter = function getUrlParameter(sParam) { var sPageURL = window.location.search.substring(1), sURLVariables = sPageURL.split('&'), sParameterName, i; for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); if (sParameterName[0] === sParam) { return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]); } } }; var submission = getUrlParameter('submission'); if(submission === "success"){ jQuery(function($) { DiviArea.show('submission-success'); }); } </script>
For some reason, I get the error:
[DiviAreas] Could not find an area with the ID: #submission-success
.I’ve confirmed I’ve added the popup to the page and double checked the ID – what am I missing?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Trigger Pop Up Based on URL’ is closed to new replies.