Problemas com Requisição Ajax/Jquery
27/03/2012
0
Estou tentando fazer uma requisição Ajax com Jquery.Porem em algumas requisições ele está alterando Ç, Â por caracteres diferentes, Gostaria de saber como faço para resolver esta situação.
Obrigado Pessoal!
Alan Miranda
Posts
27/03/2012
Alan Miranda
Então não setei nenhum charset...como posso fazer ?
27/03/2012
Joel Rodrigues
http://www.w3.org/International/O-charset.pt-br.php
27/03/2012
Alan Miranda
Então devo colocar no script de requisição ajax ? ou no meu html ?
Vlw
27/03/2012
Joel Rodrigues
Se não resolver, veja como colocar o charset no script.
Veja também a codificação do texto que está sendo recebido na requisição.
27/03/2012
Alan Miranda
<META id=mycharsetmeta content=text/html; charset=ISO-8859-1 http-equiv=Content-Type>
Alterei também no script Jquery porem sem sucesso.
<SCRIPT type=text/javascript charset=ISO-8859-8> jQuery(document).ready(function(){ var jserver = http://10.126.111.193/ibi_apps/WFServlet; var japp = core_painel; jQuery(#cb_tiporet).change(function(){ jQuery(#cb_rota).html(); var af_regional = jQuery(#cb_regional).val(); var af_tecnologia = jQuery(#cb_tecnologia).val(); var af_classe = jQuery(#cb_classe).val(); var af_uf = jQuery(#cb_uf).val(); var af_area = jQuery(#cb_area).val(); var af_elemento = jQuery(#cb_elemento).val(); var af_tipoesp = jQuery(#cb_tipoesp).val(); var teste = replaceSpecialChar(af_tipoesp); jQuery.ajax({ url:jserver, data:{ IBIAPP_app:japp, IBIF_ex:jean_xml_cp_ret_pontual_09_rota, AF_REGIONAL:af_regional, AF_TECNOLOGIA:af_tecnologia, AF_CLASSE:af_classe, AF_UF:af_uf, AF_AREA:af_area, AF_ELEMENTO:af_elemento, AF_TIPOESP:af_tipoesp, AF_TIPORET:function(){ var tam = jQuery(#cb_tiporet).val().length -1; var rota = ; jQuery.each(jQuery(#cb_tiporet).val(),function(i,data){ if(tam == 0){ rota+= \ + data + \; } else if(tam == i){ rota+= \ + data + \; } else{ rota+=\+data+\+,; } }); return rota; } }, type: GET, dataType: xml, success:function(xml){ var select = jQuery(#cb_rota); var AF_VALUE; var AF_DESCR; jQuery(xml).find(tr).each(function() { jQuery(this).find(td).each(function(){ if (jQuery(this).attr(colnum) == c0){ AF_VALUE = jQuery(this).text(); } if (jQuery(this).attr(colnum) == c1){ AF_DESCR = jQuery(this).text(); } }); select.append(<option name=+ AF_VALUE +>+ AF_DESCR +</option>); }); } }); });
27/03/2012
Joel Rodrigues
Dica: use letras minúsculas nas tags (padrão xHTML) e todos os atributos entre aspas duplas.
Ah, quando for postar um trecho de código, não use a formatação de código, pois o fórum está bagunçando o conteúdo.
Clique aqui para fazer login e interagir na Comunidade :)