Hey all,
Thanks to everyone out there helping newbies like me.
So far I have this:
$("td a").map(function () {
var theurls = $(this).attr("href");
$.get(theurls, function (tu) {
if ($('#blah', tu).length) {
$("td a").after("Yep");
}
if (!$('#blah', tu).length) {
$("td a").after("Nope");
}
});
});
It is supposed to visit each 'td a' on a page, and if a certain element is present on that page, add a yes or no next to the link. This works to a certain degree, it is visiting all the links and finding out the information, but it's adding the results from every link, to every link. (So every link on the original page gets this added to it: "YepYepYepNopeNopeYepNopeNopeYepNopeYepNope". I guess it's understandable considering the code, but I'm out of ideas on how to make it only add the text to the link it visited, if that made sense. Just to be clear, at the moment it's like this:
Link1 - YepYepNope Link2 - YepYepNope Link3 - YepYepNope
Whereas I'm hoping to get it like:
Link1 - Yep Link2 - Yep Link3 - Nope
Thanks!