Reputation: 1121
How i will get the href tag of the shortcut-icon here,please help i have extracted htmldata of entire page.
how i will get this?.
$.get(url, function (data) {
alert("Page Source: " + data);
var htmlData = data.toString();
alert("HtmlData"+htmlData);
var icon = htmlData($('link[rel="shortcut icon"]').attr('href'));
alert("icon"+icon);//Not getting icon url
});
Html has
<link rel="shortcut icon" href="//cdn.sstatic.net/stackoverflow/img/favicon.ico">
Is there is any solution?.
Upvotes: 0
Views: 230
Reputation: 36531
try this
$.get(url, function (data) {
var icon = $(data).find('link[rel="shortcut icon"]').attr('href');
alert("icon"+icon);
});
Upvotes: 2