I've been trying to find the answer to this on my own but have come up short.
Using JS/Jquery in html file, I need to:
- When a link is pressed it loads a file located on the server.
- Search the file for word x
- If that word doesn't appear or appears only once, do nothing. If it appears 2 or more times open y url.
For now I can't even properly load a file as a variable.
This is what I have tried so far:
var myvar = $.get("localhost/readme.txt").responseText;
document.write(myvar);