[tabbar] how to get parent tab Id from iframe document?

I have a tabbar with several tabs. Each tab contains a iFrame with a HTML page on it.



My question: from such a HTML page, how can I get the id of the parent tab?



In other words:



[tabbar]

[tab, id=tab1]

[html page] --> how can this page know the id of the parent tab (tab1)?

[tab, id=tab2]

[html page]

[tab, id=tab3]

[html page]



There is no stable solution for such use-case ( the content page doesn’t have any info about related tab ID ), but you can try to use next code

function get_tab_id(){
    var tabbar = top.tabbar;
    for (var id in tabbar.tabsId)
       if (tabbar.tabWindow(id) == window )
          return id;
    return null;
}

thanks!

My solution was to put the tabId in the URL of the iFrame, which works as well.