Change attributes of html loaded from a remote page?

Change attributes of html loaded from a remote page?

On the main page of a site I have this code
$("#blog").load("blog #content");

which pretty obviously loads the last few entries of a blog into a div on the current page.
Then I have this code
$("h2 a").attr('href', $("h2 a").attr('href').replace("blog/", "post.php"));

which parses all links within h2 tags and changes an address such as 'mysite.com/blog/?id=112' to 'mysite.com/post.php?id=112'
so basically all that is supposed load some posts from a remote [wordpress] blog into a div, and then replace the link in the title of the post, which links to the full story.
The posts are loaded fine into the div, and the href is changed correctly h2 links, but not in those of the #blog div loaded from the blog.
Anyone know how I can get this to work?