Jump to content
php.lv forumi

kādas īpatnības Javascript lietojot uz IE un Apache serveriem?


Recommended Posts

Bet ja nav saistības - tad kā var būt tā, ka uz mana localhosta (Apache) viss javascripts strādā gan uz IE browsera gan firefox, bet uzlikts uz servea (IIS) straadaa tikai uz firefox (uz IE nee)

un javascripts ir taads:

 

"

window.onload = function () {

var x = document.getElementsByTagName('div');

for (var i=0;i<x.length;i++)

{

if (x.className == 'label')

x.onclick = clickNav;

}

closeNav();

if (top.setNav)

setNav(top.setNav,'currentPage');

}

 

function closeNav()

{

var x = document.getElementsByTagName('div');

for (var i=0;i<x.length;i++)

{

if (x.className == 'content')

x.style.display = 'none';

}

}

 

function clickNav(e)

{

if (!e) var e = window.event;

if (e.target) var tg = e.target;

else if (e.srcElement) var tg = e.srcElement;

while (tg.nodeName != 'DIV') // Safari GRRRRRRRRRR

tg = tg.parentNode;

var nextSib = tg.nextSibling;

while (nextSib.nodeType != 1)

nextSib = nextSib.nextSibling;

var nextSibStatus = (nextSib.style.display == 'none') ? 'block' : 'none';

nextSib.style.display = nextSibStatus;

}

 

function setNav(page,newID)

{

var test = page.indexOf('#')+1;

if (test)

page = page.substring(0,test-1);

var x = document.getElementsByTagName('a');

var i;

for (i=0;i<x.length;i++)

{

if (x.href == page)

{

x.id = newID;

break;

}

}

if (i < x.length && newID == 'currentPage')

{

var parDiv = x;

while (parDiv.parentNode.tagName == 'DIV')

{

parDiv = parDiv.parentNode;

parDiv.style.display = 'block';

}

}

}

"

Link to comment
Share on other sites

×
×
  • Create New...