You run into XSS (Cross-Site Scripting) restrictions reading from / writing to separate pages, even when they are both in your own domain. The only way to avoid these entirely in JavaScript is when both pages are part of a single frameset (sorry, frames are deprecated so this is at best a short-term solution).
Using iframes will let you achieve the look, if not the fact, you want. Just open an iframe into page #2 inside a div on page #1.