Answers for "javascript get url value"

1

get value from url

// view.jsp?id=101
let queryString = window.location.search; 
let urlParams = new URLSearchParams(queryString);
let opportunity_id = urlParams.get('id');
Posted by: Guest on September-30-2021
3

get url from string javascript

function Purify(text) {
    var urlRegex = /^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/;
    return text.replace(urlRegex, function (url) {
        return '<a class="text-blurple" target="_blank" href="' + url + '">' + url + '</a>';
    })
}
Posted by: Guest on October-03-2021

Code answers related to "javascript get url value"

Code answers related to "Javascript"

Browse Popular Code Answers by Language