Ir para conteúdo
Fórum Script Brasil

ThiagoB

Membros
  • Total de itens

    1
  • Registro em

  • Última visita

Tudo que ThiagoB postou

  1. Bom dia pessoal, Estou com o seguinte problema... Fiz um menu que ao selecionar uma opção ele retorna uma outra página, isso em ajax. Criei uma página index.html, uma script.js e outra produto.php. No php4 roda tranquilo, agora no meu notebook ( que tem o Windows Vista e o Wamp 5 que é php5) não roda de maneira alguma, vou postar o código, espero que possam me ajudar. Index.html <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="pragma" content="no-cache" /> <title>Sistema CS.</title> <link rel="stylesheet" href="../style.css" type="text/css" media="screen" /> &lt;script src="script/prototype.js" type="text/javascript"></script> &lt;script src="../scriptaculous.js" type="text/javascript"></script> <link href="css/menu.css" rel="stylesheet" type="text/css" /> &lt;script src="script/menu.js" type="text/javascript"></script> &lt;script src="script/script.js" type="text/javascript"></script> &lt;script type="text/JavaScript"> function consultaProduto(obj) [color=#FF0000]{ var valor = document.getElementById(obj) //FUNÇÃO QUE MONTA A URL E CHAMA A FUNÇÃO AJAX url="busca/produto.php?produto="+ obj; ajax(url); //alert (url); }[/color] function escolha(opt) { switch(opt) { case '': switchMenu2('cnpj');switchMenu2('Empresa');switchMenu2('raisOnline'); switchMenu2('unidadelegal'); break; // case 'cagedonline': switchMenu('cagedOnline');switchMenu2('cnpj');switchMenu2('Empresa');switchMenu2('raisOnline'); switchMenu2('unidadelegal'); break; case 'produto': consultaProduto('produto');break; case 'empresa': switchMenu('Empresa');switchMenu2('cnpj');switchMenu2('raisOnline'); switchMenu2('unidadelegal'); break; case 'raisonline1': switchMenu('raisOnline');switchMenu2('cnpj');switchMenu2('Empresa'); switchMenu2('unidadelegal'); break; case 'ul': switchMenu('unidadelegal');switchMenu2('cnpj');switchMenu2('Empresa'); switchMenu2('raisOnline');break; // case 'cep': switchMenu('cep');switchMenu2('cnpj');switchMenu2('resumoCNPJ');switchMenu2('nomeESTAB');switchMenu2('resumoNOMESTAB'); switchMenu2('nomePROD');switchMenu2('resumoNOMEPROD');switchMenu2('nomeESTABEND'); switchMenu2('resumoEND'); break; } } </script> <style type="text/css"> body { background: #ffffff; margin: 0px; width: 100%; padding: 0px; color: #000000; font-family: Verdana; } </style> </head> <body> <br /> <div> <table> <span>ClickSolução - Soluções em Ti.</span> </table> </div> <div id="menu"> <ul class="level1 horizontal" id="root"> <li class="level1"> <a href="#">Aquisições</a> <ul class="level2 dropdown"> <li class="level2"><a href="#">Consulta</a> <ul class="level3 flyout"> <li class="level3"><a href="#" onclick="escolha(this.value)" value="produto">Produto</a></li> <li class="level3"><a href="#">Vencimento</a></li> </ul> </li> <li class="level2"> <a href="#">Cadastro</a> <ul class="level3 flyout"> <li class="level3"><a href="#">Produtos</a></li> </ul> </li> <li class="level2"><a href="#">Relatórios</a></li> </ul> </li> <li class="level1"><a href="#">Contratos</a></li> <li class="level1"><a href="#">Usuários</a></li> <li class="level1"> <a href="#">Funcionários</a> <ul class="level2 dropdown"> <li class="level2"><a href="#">Cadastro</a></li> <li class="level2"> <a href="#">Consulta</a> <ul class="level3 flyout"> <li class="level3"><a href="#">Nome</a></li> <li class="level3"><a href="#">Setor</a></li> <li class="level3"><a href="#">CPF</a></li> </ul> </li> <li class="level2"><a href="#">Relatório</a></li> </ul> </li> <li class="level1"><a href="#">Parceiros</a></li> <li class="level1"><a href="#">Estatísticas</a></li> </ul> </div> <table cellspacing="0" cellpadding="0" width="100%" height="10px" bgcolor="#ffcc00" border="0" > <tr height="100%"> <td width="100%" height="50%" ></td></tr> </table> <div id="retorno"> </div> </body> </html> script.js function ajax(url) { //alert(nick); //alert(msg); //alert(dest); req = null; // Procura por um objeto nativo (Mozilla/Safari) if (window.XMLHttpRequest) { req = new XMLHttpRequest(); req.onreadystatechange = processReqChange; req.open("GET",url,true); req.send(null); // Procura por uma versão ActiveX (IE) } else if (window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP"); if (req) { req.onreadystatechange = processReqChange; req.open("GET",url,true); req.send(); } } } function processReqChange() { // apenas quando o estado for "completado" if (req.readyState == 4) { // apenas se o servidor retornar "OK" if (req.status ==200) { // procura pela div id="pagina" e insere o conteudo // retornado nela, como texto HTML document.getElementById('retorno').innerHTML = req.responseText; } else { alert("Houve um problema ao obter os dados:n" + req.statusText); } } } _________________________________________________________________________ produto.php _________________________________________________________________________ <? Header("Content-type: text/html; charset=iso-8859-1"); Header('Cache-Control: no-cache'); Header('Pragma: no-cache'); $VALOR = $_GET['produto']; ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta http-equiv="cache-control" content="no-cache" /> <meta http-equiv="pragma" content="no-cache" /> <link href="css/menu.css" rel="stylesheet" type="text/css" /> </head> <body> <? echo ' <table cellspacing="0" cellpadding="0" width="90%" height="450px" bgcolor="white" border="2" align="center"> <tr width="100%" height="10px"> <td width="20%" height="5%" class="fontes">Nome do produto</td> <td width="80%" class="fontes"><input height="10px"></input></td> </tr> <tr height="10px"> <td width="20%" height="5%" class="fontes" >Valor</td> <td width="80%" class="fontes"><input height="10px"></input></td> </tr> <tr height="430px"> </tr> </table>'; ?> </body> </html> <? ?>________________________________________________________________________
×
×
  • Criar Novo...