Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.sourceIndex in FireFox doesn't work

Status
Not open for further replies.

davikokar

Technical User
May 13, 2004
523
IT
Hallo,

I have this code that works well in IE but not in FireFox:
Code:
hmnode = document.getElementById('HouseMenuNavCurrentItem').sourceIndex;

I don't know if there is a way to obtain the same in FF. Does someone knows?
Thanks
 
the html is a unordered list:

Code:
<ul id="HouseMenuNav">
<li id="HouseMenuNavItem59"><a id="HouseMenuNavLink59" href="[URL unfurl="true"]http://www.brunnerinvest.ch/HomeDE/Produkte/tabid/59/Default.aspx"[/URL] title="Produkte" tabindex="1">Produkte</a>
<ul><li id="HouseMenuNavItem67"><a id="HouseMenuNavLink67" href="[URL unfurl="true"]http://www.brunnerinvest.ch/HomeDE/Produkte/CircleEuropeFund/tabid/67/Default.aspx"[/URL] title="Circle Europe Fund" tabindex="1">Circle Europe Fund</a></li>
<li id="HouseMenuNavItem68"><a id="HouseMenuNavLink68" href="[URL unfurl="true"]http://www.brunnerinvest.ch/HomeDE/Produkte/MultiMondialFund/tabid/68/Default.aspx"[/URL] title="Multi Mondial Fund" tabindex="1">Multi Mondial Fund</a></li>
<li id="HouseMenuNavItem69"><a id="HouseMenuNavLink69" href="[URL unfurl="true"]http://www.brunnerinvest.ch/HomeDE/Produkte/BlueSpringFund/tabid/69/Default.aspx"[/URL] title="BlueSpring Fund" tabindex="1">BlueSpring Fund</a></li>
<li id="HouseMenuNavCurrentItem"><a id="HouseMenuNavCurrentLink" href="[URL unfurl="true"]http://www.brunnerinvest.ch/HomeDE/Produkte/CiranEmergingMarketsFund/tabid/70/Default.aspx"[/URL] title="Ciran Emerging Markets Fund" tabindex="1">Ciran Emerging Markets Fund</a></li>
</ul></li>
<li id="HouseMenuNavItem60"><a id="HouseMenuNavLink60" href="[URL unfurl="true"]http://www.brunnerinvest.ch/HomeDE/Kontakt/tabid/60/Default.aspx"[/URL] title="Kontakt" tabindex="1">Kontakt</a>
<ul><li id="HouseMenuNavItem74"><a id="HouseMenuNavLink74" href="[URL unfurl="true"]http://www.brunnerinvest.ch/HomeDE/Kontakt/Lageplan/tabid/74/Default.aspx"[/URL] title="Lageplan" tabindex="1">Lageplan</a></li>
</ul></li>
</ul>
 
Hi

Well, some STFW revealed that [tt]sourceIndex[/tt] is another Explorer invention. If you want something similar in other browsers, just set it yourself :
Code:
window.onload=[b]function[/b]() {
  [b]var[/b] e=document.getElementsByTagName([i]'*'[/i])
  [b]for[/b] ([b]var[/b] i=0,l=e.length;i<l;i++) e[i].sourceIndex=i
}
Personally, I would rewrite my code to not use proprietary things.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top