Jump to content
Fórum Script Brasil
  • 0

[Script] Popular 3 selects não funciona no IE


EstevãoSoberano

Question

Bom dia galera...

eu vi um tópico aqui https://www.scriptbrasil.com.br/forum/lofiv...hp/t121008.html

e fiz baseado neste script para o meu site...funcionou no chrome, opera..... mas não funcionou no IE..

alguém pode me ajudar...

Link para download do script script-erro-ie.rar

INDEX.HTML

<script src="funcoes.js" type="text/javascript"></script>

Combo 1:
<select name="combo1" id="combo1" onchange="RetornoAjax(this.value, 'pagina1.html', 'combo2')">
<option value="1">Combo 1-1</option>
<option value="2">Combo 1-2</option>
<option value="3">Combo 1-3</option>
</select>


Combo 2:
<select name="combo2" id="combo2" onchange="RetornoAjax(this.value, 'pagina2.html', 'combo3')"></select>


Combo 3:
<select name="combo3" id="combo3" onchange="RetornoAjax(this.value, 'pagina3.html', 'combo4')"></select>


Combo 4:
<select name="combo4" id="combo4"></select>
FUNCOES.JS
function RetornoAjax(id, url, container)
{
var xmlHttp=GetXmlHttpObject()

if (xmlHttp==null)
{
     alert ("Este browser não suporta HTTP Request")
     return
}

var url=url;
url=url+"?id="+id;
url=url+"&sid="+Math.random();
xmlHttp.onreadystatechange=function()
{
     if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
     { 
         document.getElementById(container).innerHTML=xmlHttp.responseText
     }
}
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function GetXmlHttpObject()
{
var objXMLHttp=null

     if (window.XMLHttpRequest)
         objXMLHttp=new XMLHttpRequest()
     else if (window.ActiveXObject)
         objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")

return objXMLHttp
}
PAGINA1.HTML
<option value="1">Combo 2-1</option>
<option value="2">Combo 2-2</option>
<option value="3">Combo 2-3</option>
PAGINA2.HTML
<option value="1">Combo 2-1</option>
<option value="2">Combo 2-2</option>
<option value="3">Combo 2-3</option>
PAGINA3.HTML
<option value="1">Combo 4-1</option>
<option value="2">Combo 4-2</option>
<option value="3">Combo 4-3</option>

alguém pode me ajudar...Vlw

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

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.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652.1k
×
×
  • Create New...