html - JavaScript window.location function not working in localhost folder -
in htdocs directory of xampp have created list directory , place simple index.html file in it.
the file contain
<!doctype html> <html> <head> <script> function redirect() { alert("file:///d:/xampp/htdocs/"); window.location="file:///d:/xampp/htdocs/"; } </script> </head> <body onload="redirect();"> </body> </html>
when navigate localhost/list/ showing blank page, , when have open directly browser it's working fine.
is there restriction url "file:///d:/xampp/htdocs/".
i want see file structure file:// url.
you can try one:
<script> function redirect() { alert("../xampp/htdocs/"); window.location="../xampp/htdocs/"; } </script>
Comments
Post a Comment