Open popup in new tab without browser alert
In this article I am sharing an awesome trick how to open popup in a new tab without browser alert. Every time we try to open window in new tab browser will give alert Please allow popups. We can do this using jquery. this will explain in below given example.
script section
body section
On click button new window tab will open without browser alert.
script section
<script type="text/javascript"> function RedirecturlinNewTab(Actionurl) { if ($('#redirectlnk').length == 0) { $('body').append("<a id='redirectlnk'></a>"); } $('#redirectlnk').attr("href", Actionurl).attr("target", "_blank")[0].click(); } </script>
body section
<body> <input type="button" onclick="RedirecturlinNewTab('http://www.google.com')"/> </body>
0 comments :
Post a Comment