javascript seo url parameters
function getPathVariable(variable) {
var path = location.pathname;
// just for the demo, lets pretend the path is this...
path = '/images/awesome.jpg/page/about';
// ^-- take this line out for your own version.
var parts = path.substr(1).split('/'), value;
while(parts.length) {
if (parts.shift() === variable) value = parts.shift();
else parts.shift();
}
return value;
}
console.log(getPathVariable('page'));
Also in JavaScript:
- date object javascript
- or operator javascript
- javascript closure stack overflow
- js kill process
- javascript is number an integer
- how to cast to javascript executor
- jquery safely use $
- send variable data from node js to front end javascript
- how to get data in json format in javascript
- react native slow performance after load iamges
- how to run a vue js hello world app in vue version 3
- saveas angular 6
- js detect os
- discord.js find word inside comment
- event loop in javascript
- react image upload
- javascript select2 sortable
- in out time of nodes
- video recorder using webrtc and javascript
- js redirect to url
- angular An accessor cannot be declared in an ambient context.
- how to create scroll to top button in reactjs example code
- jquery remove option from select by value
- assign role on reaction by id discord.js