I would like to know if is possible somehow to load a javascript or open a window with ads, when someone only view a image hosted by me, but embedded on another website and domain with (img src) tag. Thank You.
No. Not unless you provide a javascript embed code people can use to embed your images. However, that will still just work if they actually use your code - which they won't, if it's showing ads. So... I suggest "don't"
This forum does a horrible job with off topic threads. This is the PHP section. If you post your JavaScript question in the JavaScript section you will probably get more attention and responses from people who eat, breathe, sleep and jerk off to javascript.