Thread:Ckwng/@comment-26154973-20160321115500/@comment-26154973-20160323135055

for (... of ...) is ECMAScript6, maybe it wants ECMAScript5, so

function getQuery { var query = {}; var parts = window.location.search.substring(1).split("&"); for (var i = 0; i < parts.length; ++i) { var part = parts[i]; var kv = part.split("="); if (kv.length === 2) { query[kv[0]] = kv[1]; }   }    return query; }

the tab=___ part in the query is arbitrary, I just use it to link to a non-default tab from any external link (i.e. not tabview_link, suppose you want to link to G3 inside the Modernization tab from some other unrelated page; all three features are independent: initially it scroll using a given hash in the default tab, or switch to a tab using a given name in the query and then scroll using a given hash, and then there is switching/scrolling using tabview_link). Though query isn't supported that well by MW (can't just write ) and also any change to window.location.search will refresh the page (if I start changing it to reflect the current tab), so probably should use a part of the hash instead, with some arbitrary convention like   (should switch to the Modernization tab and then scroll to G3). Or just drop this feature (only scroll in the default tab for external links and switch/scroll for tabview_link, unable to link to a non-default tab externally).