Jump to content
php.lv forumi
  • 0

Js in IE


eT`

Question

Kapēc IE nestrādā šis kods?

jQuery ir pareizs.

ar $.get() arī IE nestrādāja :(

 


function setActive(id,page)
{
document.getElementById('1').setAttribute('class','');
document.getElementById('2').setAttribute('class','');
document.getElementById('3').setAttribute('class','');
document.getElementById('4').setAttribute('class','');
document.getElementById('5').setAttribute('class','');

document.getElementById(id).setAttribute('class','active');
$('#content').load('pages/'+page+'.php');
return false;
}

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

update

 


<script type="text/javascript" language="javascript">
function setActive(id,page)
{
$('#'+id).addClass("active").siblings().removeClass("active");
$('#content').fadeOut('slow').load('pages/'+page+'.php').fadeIn('slow');
return false;
}
</script>

<li id="viens" onclick="setActive('viens','index')"><a href="#">Sākums</a></li>

 

un uz visiem pārlūkiem izņemot IE strādā.

Edited by eT`
Link to comment
Share on other sites

  • 0

click eventus arī vajadzētu piešķirt ar jQuery

piešķir ul klasi, piemērā, abc.

 

Tad:

 

$(function(){

 $('.abc li').click(function(){
var page=$(this).attr('page');
$(this).addClass("active").siblings().removeClass("active");
$('#content').load('pages/'+page+'.php');
 });
});

 

 

markups attiecīgi

 


<ul class="abc">
 <li page="index">lalal</li>
 <li page="help">lalal</li>
</ul>

 

 

P.S. Bet tas, ka IE nestrādā, paskaties vai kaut kur nav console... aizmirst vai kaut kas tāds.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...