Nada, no hay manera, pongo el código de ejemplo con el que estoy trabajando a ver dónde están los errores.
archivo index.html
Código HTML:
<html>
<head>
<script src="bg.js" type="text/javascript"></script>
</head>
<body>
<img src="m_f1.png" class="background">
<img src="m_f2.png" class="background">
<img src="m_f3.png" class="background">
</div>
</body>
</html>
archivo bg.js
Código HTML:
$(".background").click(function(event){
var srcImagen = $(this).attr('src');
$("#body").attr("style", "background-image: url(" + srcImagen+ ")");
}