We have link to some page (with html code, on the same domain), that page have one img, which attributes title and alt are equal.
Script must open link (no showing on the page), grab the src attribute of img which title=alt, and throw the value into some variable.
Is it possible to do?
Thanks.
You can do it using
$.get(),.filter()and.attr(), like this:This is an asynchronous operation, so that function will execute and get the
srcwhen the response comes back, it won’t be available in the line of code after the$.get(). You need to continue whatever operation needs that info from within that function, so it continues working once the data comes back and is ready.