I am trying to create an autocomplete search bar for a website I am making, but I keep running into the same issue. It functions as it should when I launch the Brackets live preview which prompts 127.0.0.1:..../.../.../ but when I press my home button which routes me to localhost:8080/.../.../, it doesn't seem to run the code. I think it has something to do with the jQuery call, telling the function in which circumstance to run, but I'm not entirely sure. I am using XAMPP.
function autocomplete(inp, arr) { ... }
Why does this occur?
Can you explain the difference between the two?