I have an array urlResult
which collects the href
attribute of all a
elements on a component. Looks like:
All I need to do is use jQuery $.ajax()
method to check against those URL's and in each callback do something if there is success or failure. So I was thinking of something like:
$.ajax({
url: urlResult[i] // somehow use dynamic variable?
type:'HEAD',
error: function()
{
//file not exists
},
success: function()
{
//file exists
}
});
I just need some guidance on how to dynamically include urlResult
variable and pass each index to url
property in ajax call.