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! :)