Possible Duplicate:
Get entire document HTML as string
I want to find all instances of a regex pattern within a webpage. I want to do something like this:
myWindow=window.open('http://en.wikipedia.org/wiki/Javascript','_self','');
var n=myWindow.document.match(/Jav/g); // This line obviously doesn't work but how would I do this?
myWindow.document.write(n);
Is there a way to put all the text from the webpage into a string, and from that point search the string? Or, is there a way to retrieve the HTML source code, which could then be searched? How would I do this?