Skip to main content

Get Url File name without extension in Java Script


        var fPath = document.location.pathname.split('/');
        var currentFile = (fPath[fPath.length - 1]).split('.')[0]; // file name     without extension
       alert(currentFile);

This javascript code will display Url Page Name.

Comments

Post a Comment