In jQuery you can do :
$("a[href$='.img']").each(function(index) {
alert($(this).attr('href'));
}
I want to write a jQuery function which crawls x-levels from a website and collects all hrefs to gif images.
So when I use the the get function to retrieve another page,
$.get(href, function(data) {
});
I want to be able to do something like
data.$("a[href$='.img']").each(function(index) {
});
Is this possible ?
...UPDATE...
Thanks to the answers, I was able to fix this problem.
function FetchPage(href) {
$.ajax({
url: href,
async: false,
cache: false,
success: function(html){
$("#__tmp__").append("<page><name>" + href + "</name><content>" + html + "</content></page>");
}
});
}
See this zip file for an example how to use it.