javascript - changing src after page load / is executable? -
a. wondering how change src after page load using javascript
<img src="http://example.com/image.png" /> <img src="http://domain.com/different.jpg" />
b. second question follow - the new src of image (domain.com/different.jpg) displayed? execute new network request?
use jquery , write below code after document ready
a. $('img').attr('src','http://domain.com/different.jpg');
b. yes, image display , yes, execute new network request
Comments
Post a Comment