Hello.
I came across a very strange situation for me: I connected the js file with ajax handlers to the index.html file, everything works completely on my PC, but I’m coming from the phone and it doesn’t work. I checked for script support, inserted the js-code from the file directly into index.html - everything works both on the phone and on the PC.
<script type="text/javascript" src="/js/obrphp.js"></script> This is the js connection code of the file that is located inside the <head> in index.html.
Please tell me, what can this problem be connected with?
The problem with this code is:
document.addEventListener('DOMContentLoaded', e => { //Поиск людей document.querySelector('#txtsearchobch').addEventListener('keydown', function(e){ if('key' in e) { if(e.key.toLowerCase() !== 'enter') { return; } } else { if(e.keyCode !== 13) { return; } } var txtsearchobch = $("#txtsearchobch").val(); window.location.replace('?search='+ txtsearchobch +'#searchus'); }); });
type="text/javascript". Ifdoctype html5, then you should remove the type, but I doubt that the problem is this. And of course, the problem may be in the phone itself, in the browser that is used, etc. - olegatroe => {syntax, which is very poorly supported. If you do not have transformation libraries, you need to rewrite. - Ivan Pshenitsynbabelwrote for good reason. - olegatro