Sharing js data between embedded forms - howto?

I’d want to share few functions and static data objects between embedded forms. How to?

Yes, I can do it via global structure. But it is very dirty way. Hope, there is some more accurate approach, isn’t it?