I make small games in Construct 2, and I need a little help with javascript, ajax, or something. I need to search for something in a specific internal web page.
I need to search if my 'pub-id' is in the 'ads.txt' of each domain where my game is. The problem is that I can't figure out how to crawl to other internal pages, because using 'document' didn't help me out.
What i've tried:
var id='2314121'; //my id
var found = document.documentElement.innerHTML.indexOf(id); //it's searching my id in the HTML code
if(found >= 0) //it will return -1 if it's not there, and position if's there
{
alert('Found it at position: '+found);
}
The problem is that this will search just on the current page, and I need to search in a specific one. I need to search in 'www.domainexample.com/ads.txt'.
I found how to tell on which site I am with 'window.location.host', but I'm stuck here. I can't crawl from the index to ads.txt.
Anybody knows how to make this?
Thank you! :)