Mercurial > daily-edition
changeset 35:6495497409dc
fixed js code to work in safari
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Sun, 03 Jan 2010 12:33:08 -0800 |
parents | 651e7f56d4c1 |
children | 5ab0068cff9d |
files | daily-edition.js |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/daily-edition.js Sun Jan 03 12:29:49 2010 -0800 +++ b/daily-edition.js Sun Jan 03 12:33:08 2010 -0800 @@ -22,9 +22,14 @@ div.find(".title .link").html(article.title); div.find(".title .link").attr("href", article.url); div.find(".author").text(author); - var html = [content.value - for each (content in article.content) - if (content.type == "text/html")]; + + var html = []; + article.content.forEach( + function(content) { + if (content.type == "text/html") + html.push(content.value); + }); + if (html.length > 0) { var content = div.find(".content"); content.html(html[0]);