Get url info and break up into classes then add to body class
How do I make an get url info and break up into classes then add to body class?
What is a get url info and break up into classes then add to body class? How do you make a get url info and break up into classes then add to body class? This script and codes were developed by Michael Stursberg on 27 October 2022, Thursday.
Get url info and break up into classes then add to body class - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Get url info and break up into classes then add to body class</title>
</head>
<body> <div class="container"> <body class="<span id='example'></span>" >
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Get url info and break up into classes then add to body class - Script Codes JS Codes
//Getting the URL dynamically
var url = $(location).attr('href');
// Getting the file name i.e second to last segment of URL
var fn1 = url.split('/').reverse()[1];
var fn2 = url.split('/').reverse()[2];
var fn = url.split('/').reverse()[0];
// Getting the file name i.e last segment of URL with out ext (i.e. example )
var fn0 = fn.split('.').reverse()[1];
$("body").addClass();
$("#example").text(fn2 + " " + fn1 + " " + fn0)
console.log(fn2 + " " + fn1 + " " + fn0);
Developer | Michael Stursberg |
Username | thesturs |
Uploaded | October 27, 2022 |
Rating | 3 |
Size | 1,651 Kb |
Views | 12,144 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Slim Grid SASS SCSS mixins - Beta | 2,556 Kb |
JQuery Sticky Element 1 | 1,917 Kb |
Test Blur | 1,511 Kb |
GetViewport4CSS | 1,333 Kb |
Awesome Bookmarklets | 18,873 Kb |
Key Detection | 1,530 Kb |
Automatically Generate a Google Address Link or Map | 2,069 Kb |
Slim Grid SASS SCSS v3.2 | 4,709 Kb |
Slick Slider img or vid autoplay | 2,496 Kb |
Slim Grid SASS SCSS v4 BETA | 4,976 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Simple star rating using js and data-uri | TheEnd | 5,795 Kb |
Pomodoro Timer | Sdas13 | 2,900 Kb |
Test | Dviate | 2,668 Kb |
Product item | Mymahesh11 | 2,256 Kb |
SVG Playground | Roygwells | 1,834 Kb |
Hovers with popups | Zacharyolson | 2,380 Kb |
Single element checkbox | Ivijaygupta | 1,996 Kb |
Use the Twitchtv JSON API | Roksanaop | 3,561 Kb |
About Mazano | Kiti | 2,585 Kb |
Multiple jCarousel | Pafnuty | 2,461 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!