Created
July 2, 2017 16:36
-
-
Save shahid249/595e47a02758efd2f3c621ce6b005105 to your computer and use it in GitHub Desktop.
open url in new windows and close in 5 seconds automatically - Javascripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// put url by replacing http://example.com | |
//HTML Code | |
//<a href="javascript:void" onclick="loadUrl('http://example.com')">url</a> | |
<script type="text/javascript"> | |
function loadUrl(newLocation) | |
{ | |
var win = window.open(newLocation, '4536453645', 'width=500,height=200,left=375,top=330'); //adjust height weidth of window | |
setTimeout(function(){win.close()}, 5000);//5000 defines time 5000 = 5 sec | |
return false; | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment