javascript - Use AJAX to find element's text -
i'm trying find way use ajax (doesn't have ajax if there better way please so) in chrome extension download few pages contents of each < > tag stored in array.
every page has similar - varied inner text -:
<html> <body> <a href="#">computer</a> <br /> <a href="#">monitor</a> <br /> <a href="#">mouse</a> <br /> <a href="#">keyboard</a> <br /> </body> </html>
i'm able use/prefer jquery.
thanks, don't have code me. i'll figure out myself if pointed in right direction.
edit: i'm trying retrieve data other pages , store them in array.
myarr being array want put them in...:
var myarr = []; $.ajax({ type: "get", url: "myurl.html", datatype: "html", success: function (data){ $(data).find("a").each(function(){ myarr.push($(this).text()); } } });
Comments
Post a Comment