Yes, don't use frames. They are probably messing with the scope of your objects because one object is on one html page, and the other object is in another html page. Consider using something else for your containers.
It's not so much the frames causing the issue but the difference sources being out of scope from each other. You might can get away with using frames if both frame sources are referencing the same global javascript object (file). But anything that you change in source1 will not be known in source2. You'd also have to maintain data in your global object.
There is a dojo layout that you could utilize if you don't want to write your own. Also look into a single page application along with a dojo layout. The concept here is that all of your code will render on the same page (it can affect performance if you're no careful).