Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- $(document).ready(function() {
- var getURL = window.location.pathname; /* Gets the URL */
- var hyphened = getURL.replace(/\s/g, '-'); /* Removes spaces and adds hypens to URL if they exist */
- var finalstr = hyphened.substring(hyphened.lastIndexOf('/') + 1); /* Grabs the final string after the last '/' */
- var lowercase = finalstr.toLowerCase(); /* Converts to lowercase letters */
- if(lowercase != '')
- {
- $('$projectname$').addClass(lowercase); /* Adds the SEO URL as a class to div#Dx1Base */
- }
- else {
- $('$projectname$').addClass('home-page'); /* Adds home-page as a class to the div#Dx1Base */
- }
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement