简体   繁体   中英

javascript how to close chrome window without alert?

i open url through php in chrome browser like

exec('chrome.exe --app="www.example.com/inex.php?pid=4356546"');

my index.php have some js code it end of js code to close this opened window i call

window.close();

but it give me alert that localhost says [object Object] and OK button

so i was wondering anyway to close this window without any alert , because i will be lunching these windows on server side on my windows server and i want to close them with js

This will be works in Chrome-26 without the use of a helper page:

<script type="text/javascript">
   window.open('javascript:window.open("", "_self", "");window.close();', '_self');
</script>

may be it'll help for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM