Suppose I have an html string like so :
var string = '<div><img src="foo/bar" /></div>';
and I select the image part of it like so :
var $img = $(string).find('img');
and then I change the ‘src’ attribute :
$img.attr('src', 'foo2/bar2');
Does this trigger an automatic AJAX get request at the new ‘src’? I’m getting a rogue GET error in my code that goes away when I comment out the line above, but maybe it’s coming from somewhere else.
If this is in fact coming from Jquery, is there a way to turn off or block the AJAX request? I’ve tried .stopPropogation() without any luck…
in case that
$imgis a real dom elemnt (exists in your html) – a get reqest will fire.if
$imgis not you won’t trigger a get request but you can still trigger it by:the only way you can stop a browser from rendering images is by stopping it: