0

これはRSSフィードからのxmlファイルのスニペットです

<item>
<title>creamy whites</title>
<description>&lt;p&gt;&lt;a href="/pin/201606520789168653/"&gt;&lt;img 
src="http://media-cache.pinterest.com/upload/229261437250994034_0HxSxJNv_b.jpg"
&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;creamy whites&lt;/p&gt;</description>
</item>

これは、すでにZRRSfeedにあるコードです。

// Add feed row
html += '<li class="rssRow '+row+'">' + 
    '<'+ options.titletag +'><a href="'+ entry.link +'" title="'+          
        feeds.title +'" target="'+ options.linktarget +'">'
        + entry.description +'</a></'+ 
        options.titletag +'>'

今、 私が試し た範囲内の値entry.decriptionを取得したいのですが、、、、(ここでこのコードのいずれかを誤って入力した可能性があります-しかし、それらを試したとき、私はグーグルで次のようなものをチェックしました' getAttribute')そしてそれらのどれも機能しませんでした。srcentry.decriptionentry.decription[src]entry.decription[src].val()entry.decription->src entry.decription.attr(src)entry.decription.getAtrribute("src")

4

2 に答える 2

1

これを試してみてください..

var src = $('entry.description')find('img').attr('src');

console.log(src); // debug using console firebug in firefox
//or developer tools in chrome
//the output should be the url of img

次に、アンカー タグ内にある entry.description を src に置き換えます。

于 2012-05-22T13:10:33.953 に答える
0

試す

$(entry.description).find('img').attr('src')
于 2012-04-14T22:18:04.863 に答える