Getting the index container name

So I found that if I am only using the hype page as the web page then all works well with the above when exporting.

But if I insert the hype div into another document then var hypeMainContainerName = $( "body div:first-child" ).attr('id'); gets broken. Which I guess I expected.

using:

var hypeMainContainerName  = $("[id$='_hype_container']")[0].id ;

to find the first div that ends with _hype_container resolves this where I only have one hype inserted. (Which I think will be the normal case scenario )

But I did run into something I did not expect but I guess should have.

My hype doc has jquery added to the resources. But I had to also link it to the main pages head

@Daniel do you know of a better way of doing this. It would be much easier if the main hype div had a unique class name we could use. something like class="hyp_dn_name"
Not only for getting this index/document name but we could also use in some of the scenarios here:

by obtaining the hyp_dn attribute of the uniquely named div which is the document name