view about-mozilla.js @ 1:4dd50afc32c8

Successfully getting headlines and body of each article.
author Atul Varma <varmaa@toolness.com>
date Sat, 28 Feb 2009 13:02:50 -0800
parents 58d9c5ef124e
children 2be94bbd7f04
line wrap: on
line source

function onIssueLoaded() {
  $("a[name]").each(
    function(i) {
      var headline = $(this).next().text();
      var body = $("<div></div>");
      for (var node = $(this).parent().next();
           node.length && !node.find("a[name]").length;
           node = node.next(":not(.postmetadata)"))
        body.append(node.clone());
    }
  );
}

$(window).ready(
  function() {
    $(document.body).load("issue-2009-02-24.html .entry",
                          null,
                          onIssueLoaded);
  });