Matt Elhotiby
Matt Elhotiby

Reputation: 44066

How do I extract the first part of a url?

Given:

http://something.com:4567/data/21/28/188

How do I get only the following with JavaScript?

http://something.com:4567/

Upvotes: 0

Views: 444

Answers (1)

Daniel Mendel
Daniel Mendel

Reputation: 10003

window.location.protocol+'//'+window.location.host

Upvotes: 3

Related Questions