zRSSFeed调整JS输出

时间:2013-04-25 05:24:02

标签: javascript jquery rss

我正在使用zRSSFeed来显示带有图像的Feed,它运行得很好,只是我在修改输出的HTML顺序时遇到了一些麻烦。我希望图像先出现。 HTML输出是:

<h4>
    <a title="View this feed at" href="http://someurl.com/image.jpg" target="_self">This is an image</a>
</h4>
<div class="date">04/16/2013 01:49:15</div>
<p class="image">
    <img src="http://someurl.com/image.jpg">
</p>

我找到了输出这个的JavaScript,并试图玩这个命令,但事情很容易破解。

e.linkredirect && (k = encodeURIComponent(k));
j[d].html = '<' + e.titletag + '><a href="' + e.linkredirect + k + '" title="View this feed at ' + b.title + '">' + g.title + '</a></' + e.titletag + '>';
e.date && a && (j[d].html += '<div class="date">' + a + '</div>');
e.content && (g = e.snippet && '' != g.contentSnippet ? g.contentSnippet : g.content, e.linkcontent && (g = '<a href="' + e.linkredirect + k + '" title="View this feed at ' + b.title + '">' + g + '</a>'), j[d].html += '<p class="image">' + g + '</p>');

我可以在第一个实例中有效地将图像放在j [d] .html的开头,并使用e.linkredirect获取src,但是如果我将其重新用作没有图像的Feed,这将无效正常。图像将添加到带有“图像”类的段落中。关于我如何工作的任何建议?

0 个答案:

没有答案