I’m designing a comment service that will plug and play with any website that it’s dropped on. Right now, I’m using an iFrame for the comment contents but the problem is I can’t expand the vertical height since it’s cross domain and I don’t know what the height of the internal iFrame is.
The question is.. should I just use a DIV instead?
Basically the client pops in a piece of JS and sets an empty DIV: <div id='myService'></div> and I’m wondering if I should simply place the contents into that DIV or pop an iFrame in there?
I think your code should definitely live in an iframe.
It may be frustrating, but it is important to keep styles separate and javascript separate. By which I mean if you put your code right into their div then you could inherit styles/javascript handlers from the main site.
If this is a widget it should be up to the client to make room on their page to accommodate it. Look at how google/facebook/twitter does it. They offer widgets of different dimensions. All are hosted in iframes.