News for hackers. Stuff that matters.
Re:Book on Third-Party JavaScript from engineers at Disqus (... by krosaen on Monday August 29, 2011 @09:32PM (#2939750)
Great topic for a book, just ordered it. To support embeddable menus for Real Time Farms we went with:

- a script include that is very lightweight and only

- document.writes an iframe and

- asynchronously loads a helper script to deal with cross domain communication so that the frame can change height when the menu tabs change

See it in action here http://www.northernspyfoodco.com/menus/dinner

it eventually loads the iframe with this content:

http://www.realtimefarms.com/restaurant/northern-spy-food-co...

The benefit of using an iframe so far has been much easier reuse of code for the widget content. However, we've had a few folks request to use their own stylesheet which can't be supported (instead we offer a configuration of the embed snippet to style a few things like menu width, fonts family and colors).

In any case, if we learn even a single helpful trick about embedding rich content from this book, it will have been money well spent!

Re:Book on Third-Party JavaScript from engineers at Disqus (... by bentlegen on Monday August 29, 2011 @10:06PM (#2939826)
Very cool widget. Integrates really well with the page - if you hadn't told me, I'd have no idea it was being served externally.