there is such a code

function Ajax_find(name) { if(name.length > 1){ $.post("/search", {'имя': name}, onAjaxSuccess); function onAjaxSuccess(data) { document.getElementById('table').innerHTML = decodeURIComponent(data); } } } 

In chrome, everything works fine, Firefox does not send requests to the server, and IE8 sends requests but does not receive an answer, just by the will of fate you have to make a frontend, and in it I am not at all strong, the server is self-written on Node

HTML part such

 <form> <input type="text" name="name" size="30" onkeyup="Ajax_find(this.value)" autocomplete="off" autofocus> <div id="search"></div> <p><b>Поиск по</b></p> <input type="radio" name="browser" checked="checked"> Фамилии <input type="radio" name="browser" > Имени <input type="radio" name="browser" > Отчеству </form> 

    1 answer 1

    1. do not use Russian parameter names
    2. look more often in the console, FF clearly writes that it cannot find the onAjaxSuccess function, and does it right - there is nothing to declare them inside the function in this way. Either define the function variable above the Ajax, or the function itself in the global drag.

    either as i did see http://jsfiddle.net/SanSYS/wj5gttkL/

     function Ajax_find(name) { if (name.length > 1) { $.post("/search", { 'name': name }, function onAjaxSuccess(data) { document.getElementById('table').innerHTML = decodeURIComponent(data); }); } } 
     <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <form> <input type="text" name="name" size="30" onkeyup="Ajax_find(this.value)" autocomplete="off" autofocus> <div id="search"></div> <p><b>Поиск по</b> </p> <input type="radio" name="browser" checked="checked">Фамилии <input type="radio" name="browser">Имени <input type="radio" name="browser">Отчеству </form> 


    PS: see the console only on jsfiddle, something is not right here)

    • Clearly, I took the function out and everything is OK, but with IE8, which is what I was afraid of, it normally does not support innerHTML - pnp2000
    • @ vnn198, use the jquery.html function) - SanŚ́́́́́́Ś́́́́
    • Yes, it does not help because "This method uses the browser's innerHTML property". And IE cant is that it has almost all innerHTML property read only - pnp2000