CodeIgniter+javascript+IE

#1
[eluser]Unknown[/eluser]
Hello!

I have a application with a menubar anda a secundary left menu that is called by a simple innerHTML javascript.
the code is

the extract of view file:

<div id="menu">
<ul id="menubarra">
<li>&lt;a onclick="montamenu('ensino')"&gt;ensino</a></li>
<li>&lt;a onclick="montamenu('pesquisa')"&gt;pesquisa</a></li>
<li>&lt;a onclick="montamenu('extensao')"&gt;extens&atilde;o</a></li>
</ul>
</div>
</div>
<div id="menuesquerda"> // the div to put the secundary menu.
</div>

the javascript code:


function montamenu(menu) {
if (menu=='ensino') {
var leftmenu = "<ul><li><a href="+base_url+"ensino/habilitacoes>habilita&ccedil;&otilde;es</a></li>"+
"<li><a href="+base_url+"ensino/disciplinas>disciplinas</a></li>"+
"<li><a href="+base_url+"ensino/docentes>docentes</a></li>"+
"<li><a href="+base_url+"ensino/vestibular>Informa&ccedil;&otilde;es ao vestibulando</a></li></ul>"
} else if (menu=='pesquisa')
{
var leftmenu = "<ul><li><a href="+base_url+"pesquisa/projetos>Projetos em Andamento</a></li>"+
"<li><a href="+base_url+"pesquisa/publicacoes'>Publica&ccedil;&otilde;es</a></li>"+
"<li><a href="+base_url+"pesquisa/tcc>TCC&acute;S dos Alunos</a></li></ul>"
}
else {
var leftmenu = "<ul><li><a href="+base_url+"extensao/projetos>Projetos em Andamento</a></li>"
}
document.getElementById("menuesquerda").innerHTML=leftmenu
}


the question is:

In the firefox browser everething is ok but they don´t work in IE.

Someone could help?
Thanks!

#2
[eluser]Bulk[/eluser]
Any javascript errors in IE?

#3
[eluser]giaodn[/eluser]
This is JavaScript problem, there no relation to CI + JS. I try to debug and the code below is the code that run correctly in both IE and FI, hope it useful for you:

Crying, try to post the html code for you but i can't because of the post function cannot handle HTML code correctly Sad, sorry

#4
[eluser]Unknown[/eluser]
[quote author="giaodn" date="1182526962"]This is JavaScript problem, there no relation to CI + JS. I try to debug and the code below is the code that run correctly in both IE and FI, hope it useful for you:

Crying, try to post the html code for you but i can't because of the post function cannot handle HTML code correctly Sad, sorry[/quote]


It´s possible send me the HTML code by mail in
rsr.bgt at ig.com.br ?
Or, where I can find some documentation of IE Javascript padronization?

Thanks

#5
[eluser]Unknown[/eluser]
Dear Rael, I think it does work, but it was postback because you don't put return false on event onclick in anchor

There are 2 alternatif for calling javascript function in anchor:
1. &lt;a onclick="montamenu(’ensino’);return false;"&gt;ensino&lt;/a&gt;
2. &lt;a herf="[removed]montamenu(’ensino’)"&gt;ensino&lt;/a&gt;

Hope this will help you.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.