My Greasemonkey script is not finding the elements (links) on the page?
问题 The website is: lexin.nada.kth.se/lexin/#searchinfo=both,swe_gre,hej; My script is: function main(){ var links=document.getElementsByTagName("a"); alert("There are " + links.length + "links."); } main(); Running the script gives me two alert messages saying There are 0 links. Any ideas why I can't get the right amount of links from the document? And why do I get the alert twice? 回答1: The alert fires more than once because that page contains iFrames (with, de facto, the same URL as the main