Extracting Current Page Handle Using Javascript Location Object

This will extract just the file name portion of the current page.


//e.g. location.href = www.domain.com/example.php
console_log(location.pathname.substring(1));
//displays: example.php

Leave a comment

2 Comments.

  1. It’s great that you are getting ideas from this article as well as
    from our discussion made at this time.

  2. This is the most essential product in the server rooms,
    laboratories, nuclear sites, refineries, synthetic resin production centers, data centers, storage centers, and
    pharmaceutical facilities, where temperature changes are very crucal to the processes.
    The machines may either be single stage blow molding
    machines or modern automatic PET blow molding machines. What else is important when feeding
    my companion animals.