Tutorial Current Page with JavaScript
This is like a replacement for PHP's SCRIPT_NAME with JavaScript. location.href.split('/').pop(); For example with this URL: htt...
https://iskablogs.blogspot.com/2014/03/tutorial-current-page-with-javascript.html
This is like a replacement for PHP's SCRIPT_NAME with JavaScript.
location.href.split('/').pop();
For example with this URL:
http://css-tricks.com/examples/ScriptName/index.php
This code:
document.write( location.href.split('/').pop() );
Would write to the page: "index.php"
Reference URL
location.href.split('/').pop();
For example with this URL:
http://css-tricks.com/examples/ScriptName/index.php
This code:
document.write( location.href.split('/').pop() );
Would write to the page: "index.php"
Reference URL