Reputation: 491
$.ajax({
url: link, //https://www.linkedin.com/company/666511/
type: 'GET',
success: function (data) {
console.log(data)
//response comes in 2000 lines
here is the sample short response
["Web Development","Professional Training","Apprenticeship","Nonprofit"]
,
"companyPageUrl":"http://www.thedifferenceengine.io"
//i only want this link to return
http://www.thedifferenceengine.io
}
});
i dont understant what regex or jquery require or how i remove this "e and get companypageurl
Upvotes: 0
Views: 34
Reputation: 2310
var decode ='["Web Development","Professional Training","Apprenticeship","Nonprofit"],"companyPageUrl":"http://www.thedifferenceengine.io"';
alert($("<div/>").html(decode).text());
Upvotes: 0
Reputation: 10458
you can use the regex
/http:[^;]+/
let str = '["Web Development","Professional Training","Apprenticeship","Nonprofit"],"companyPageUrl":"http://www.thedifferenceengine.io"'
console.log(str.match(/http:[^;]+/));
Upvotes: 2