I am currently creating an email plugin for a stats/reporting package we use. We use a third party mail distributor who run a pretty cool mail management package.
The upshot is that I'm trying to develop a plugin that allows us to preview the emails before they're sent. The mail client offer a simple JSON lookup, and this seems to fit the bill.
I'm previewing this content in an iframe in order to separate possbly contradicting CSS etc.
However: I don't actually know how to change the content in an iframe.
To be clear as well: I don't want to change the URL, I want to entirely re-write the content of the iframe. I've looked around an no one seems to tackle that specific problem... they only change the URL.
SO here's the question in pseudo-code:
[this function is called onMouseUp() from a select pull down in HTML]
var replacement = '<div>Hello world. This is new content.</div>';
$('epframe').CompletelyReplace(replacement)
I'm sure it's not too hard, but I'm not the best at jQuery/Javascript, so does anyone have any pointers?
Many thanks. Rick