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
Sep 2nd, 2025
For years, creating digital content was all about one thing: pleasing search engines. If you ranked on Google, you won. Everything else—social shares, referrals, even conversions—usually flowed from that visibility. […]
Read more
Aug 28th, 2025
Grocery supply chains form the backbone of food distribution, ensuring products move from farms and manufacturers to store shelves and, increasingly, to customers’ doorsteps. Traditionally, these supply chains struggled with […]
Read more
Aug 7th, 2025
Creating responsive, efficient, and visually engaging web layouts is a priority for today’s developers. In 2025, two CSS layout models—Flexbox and CSS Grid—have become indispensable in modern web design. While […]
Read more