javascripthtmlshtml

Why doesn't this code convert the URL to lowercase?


This is in my 404.shtml file

<script> var oldUrl = window.location.href; var newUrl = oldUrl.toLowerCase; location.href = newUrl; </script>

Solution

  • I think var newUrl = oldUrl.toLowerCase; should be var newUrl = oldUrl.toLowerCase();, since it is a function.