Показать сообщение отдельно
  #5 (permalink)  
Старый 18.05.2010, 17:12
Новичок на форуме
Отправить личное сообщение для vvova Посмотреть профиль Найти все сообщения от vvova
 
Регистрация: 17.05.2010
Сообщений: 3

При более детальном рассмотрении англ. буквы в порядке.
Значит кодировка.
Как мне кодировку выставить в javascript
http://opt-product.info/index.php?option=com_content&view=article&id=2&Ite mid=4&grp=35

Javascript

function createObject() {
var request_type;
var browser = navigator.appName;
if(browser == "Microsoft Internet Explorer"){
request_type = new ActiveXObject("Microsoft.XMLHTTP");
}else{
request_type = new XMLHttpRequest();
}
return request_type;
}

var http = createObject();

function autosuggestReply() {
if(http.readyState == 4){
var response = http.responseText;
e = document.getElementById('results');
if(response!=""){
e.innerHTML=response;
e.style.display="block";
} else {
e.style.display="none";
}
}
}

function autosuggest()
{
q = document.getElementById("src_id").value;
// Set te random number to add to URL request
nocache = Math.random();
http.open('get', 'search.php?q='+q+'&nocache='+nocache);
http.onreadystatechange = autosuggestReply;
http.send(null);
}

search.php

<?php

if (isset($_GET["q"])) $searchq=strip_tags($_GET['q']); else $searchq='';
echo $searchq;
?>

форма

<form action="..." method="post">
<input type="text" name="src" id="src_id" style="width:396px" value="<?php print $vvv_src; ?>" onkeyup="javascript:autosuggest()" AUTOCOMPLETE="OFF"/>
<input type="submit" value="Найти" />
<div id="search-wrap">
<div id="results"></div>
</div>
</form>
Ответить с цитированием