Partial Code:
My below code pulls a query from my DB and then uses inner.HTML = to display the data inside a div. It works fine in it original use....
Howeve
You can do it! Read here for more info
You can affect the document with contains the iframe by setting and getting variables from the window element:
// normally you use...
var whatever = "value";
// use the window object instead, which is shared
// between the iframe and the parent
window.whatever = "value";
The other thing you should know is that you can access the main document via the parent object
inside the iframe you can use...
parent.someattr;
// or try this
parent.getElementById('some_element');
I think what you want is:
parent.getElementById('posts').innerHTML = 'why doth this faileth?';
The part in the iframe isn't considered the same document.
you have to use parent.