var entry = result.feed.entries[i];
var div = document.createElement("div");
の出力のどこかに
div.appendChild(document.createTextNode(entry.content));
いくつかあります
<img src="http://ww...
画像のURLを取得する簡単な方法はありますか? たぶん.matchで何か?
var entry = result.feed.entries[i];
var div = document.createElement("div");
の出力のどこかに
div.appendChild(document.createTextNode(entry.content));
いくつかあります
<img src="http://ww...
画像のURLを取得する簡単な方法はありますか? たぶん.matchで何か?
これが私がやった方法です..
var findImg = entry.content;
var img = $(findImg).find('img').eq(0).attr('src'); //i use jquery to find 1st img src
function imgFeed(){
var defaultImg= "images/default.jpg";
if(img==null){
return defaultImg; // if cant find any, show default image src
}else{
return img;
}
}
yourElement.append('<img width="194" height="91" src="'+imgFeed()+'" alt="#" />');