Changing the .src of an <iframe> is *NO DIFFERENT* than loading a brand new HTML page into the main window.
It *COMPLETELY* wipes out *EVERYTHING* in the window/iframe and replaces it with the new HTML source.
In other words, it is no different than doing
location.href = "someNewPage.html";
and expecting the JS objects on the page to remain in memory. They won't. Period.
This is, essentially, what AJAX was created for: To allow changes to a page's contents without affecting what already exists except as dictated by the JS code.