I think my question is fairly straightforward but I'm not very experienced with Javascript. What I am trying to do is pull the source code of a page and stick it all into a variable:
var sourcecode = document.documentElement.innerHTML;
Then I have an array of terms that I want to search that variable for:
var array = ['Huskers','Redskins','Texans','Rockets'];
I would like to assign a 0 to any of the array elements that aren't found in the sourcecode
variable and a 1 to any that are. So, when the search is complete each array element will be represented by a variable that will either equal 1 or 0. Can anyone please give me a hint as to how I should go about this?
Thanks!
sourcecode
or something else? – leonhart Jun 12 at 3:14