Try this:
$("#m"+id).load("//your link");
You can read more on this on: api.jquery.com/load/
Check this link
This plugin loads images / background url after the DOM load event and window load event are triggered.
Initially the src attribute of the img tag will be set to empty. And the html should contain a data attribute which will contain the image path. The plugin will take care of the rest of things.
After image loads, the below code will be executed. All these are handled by the plugin
$('img').attr('src', < data URL with the img path > )
The display: hidden
set on your <img>
element should be display: none
. Also, bear in mind that users visiting your page with JavaScript disabled will never see the image, only the permanent loading message. You should use a gracefully degrading solution instead.