Sometimes it may be needed that you need to give a close link in the popup you created. We have shared the function for how to close the popup in jQuery after submitting the form.
If you want to track conversion of contact us page by defining its Thank You page then also this function will help you.
If you want to redirect the page to somewhere else then use this function like this:
Core PHP
_redirectJs(‘dashboard.php’)
Codeigniter
_redirectJs(‘controller/function’) OR
if you have defined url in route file
_redirectJs(‘dashboard’)
jquery function is as follows:
function _redirectJs($tourl = ”) {
if ($tourl == ”) {
$tourl = ‘home’;
}
$script = ‘<script type=”text/java
script”>
var local = location.pathname.split(“/”);
local.pop(); // remove the filename
local.push(\”.$tourl.’\’);
local = location.protocol+”//”+location.hostname+””+local.join(“/”);
top.location.href = local;
</script>
‘;
echo $script;
//code
}
Related Posts...
CSSPHPTechnologiesWeb Design
Apr 18th, 2024
Your corporate website is a critical component in shaping perception of your brand. Discover how elements like design, content, and UX influence how customers view your company. We break down key strategies to align your site with your brand identity.
Read more
Apr 11th, 2024
Discover how Singsys’ expertise in website development can help your business succeed with responsive and intuitive websites. Enhance user experience and boost conversions today!
Read more
Apr 2nd, 2024
As consumers’ expectations continue to rise, delivering an exceptional user experience (UX) has become a key differentiator for businesses seeking to gain a competitive edge.
Read more