How to change the background body ajax?

Hello!
There is such script, which loads the page without reloading
But the background on the new page, to overload 1 and the same

How am I supposed to overcome?
public static CreateAjaxRequest(UrlName,UrlState){
 // history.pushState('game','Game',UrlState);
 $(document).ready(function () {
$.ajax({
 url: UrlName,
type:'GET',
dataType:'text',
 success:function (response) {
console.log(response);
$('body').html(response);
}
})
});
 }
June 5th 19 at 21:00
2 answers
June 5th 19 at 21:02
Solution
$('body').style('background-color') = response;

or if it is a picture:

$('body').style('background-image') = 'url(' + response + ')';
June 5th 19 at 21:04
$('body').style('background', response) ;
Curses , for some reason , on this line - donavon_Pagac96 commented on June 5th 19 at 21:07
well et if just the background color to change, and so comrade above has written is true - Drake_Fisher commented on June 5th 19 at 21:10

Find more questions by tags AJAXJavaScript