You can't do something "like that URL" with just javascript. Using a service such as the url you specified, they're doing the processing: watermarks, crops, resizing, etc. They offer a few ways for users to implement it. If you decide you wanted to use their service along with you're own frontend javascript application, for client-side use, then you could simply use javascript, along with their API.
It looks like their JS example shows including the authorization key:
params: {
auth: { key: "YOUR-AUTH-KEY" },
Which is how they charge for their service.
It sounds like you're a little new, so you're going to have to understand client-side vs server-side.
You can use something like imagemagick to do this on your own server. What language is your site in, or intended to be in?