Hello everyone how to get domain name from url using jquery . I have try it's working but one issue face.
How to get domain name.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Hello everyone how to get domain name from url using jquery . I have try it's working but one issue face.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Sachin SinghRank #66 · 26.2K reputationPosted Feb 17, 2022, 12:22 AM EST
var url = window.location.href; var domain=url.replace(/.+\/\/|www.|\..+/g, '');