Extracting specific string in a url using java code/javascript [closed] - javascript

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I have the below url and I need to get back the value after api/ which is nam.
http://apidtgateway.mycompany.co.za:9800/agencychannel-uiapiservices/api/nam/CrmUserManagement/SaveActivity
Any help would be highly appriciated thanks in advance.

Here is how you will do it.
var URL = "http://apidtgateway.mycompany.co.za:9800/agencychannel-uiapiservices/api/nam/CrmUserManagement/SaveActivity";
if (URL.indexOf("api/") >= 0) {
var part = URL.split("api/")[1].split("/")[0];
console.log(part);
}

Related

Get parameters from URL with JS or jQuery [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I've this type of URL:
https://example.com/page#param1|param2
How can I get param1 and param2 ?
Thanks.
Those are part of the hash if you are getting them from the current url.
_hash = window.location.hash.split("|")
console.log(_hash)

How add time local of my computer in may page html [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I like to display my time local in my page html , javascript , and i can use momentjs ? Please who can help me ?
Simple:
document.body.textContent = new Date().toLocaleTimeString()

Base64: How can i convert a URL to base64 format? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
i do have question, i have a PDF file fetched in my server which returns a resource location URL, I want to convert it to base64 how do i do that? thank you
I hope this can help you
btoa('www.aws.com/pdf.file') //"d3d3LmF3cy5jb20vcGRmLmZpbGU="

Get sound rhythm - javascript [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
how to get rhythm using js or jquery
Following soundcloudes and this image :
what is this name ?
If I understand you right you are looking for a way to generate waveforms. Try this library http://p5js.org/reference/#/p5.FFT

Delete number after slash in javascript [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Hey lets say I have url like this:
http://google.com/1/2
How do I delete last number(after last slash character)? all numbers can vary in length.
var URL = "http://google.com/1/2";
var newUrl = URL.substring(0, URL.lastIndexOf('/'));
console.log(newUrl);

Categories

Resources