problem with altering css wtih background-image

problem with altering css wtih background-image

hi i'm developping an application mobile and i find a problem but i have no idea about how to fix it.

i use a webservice to get one picture in base64 if the webservice answer sending nothing i put a default picture.

it's work fine on ie, but when i m using safari on the navigator it doesn t work any idea about how to solve it

Thanks for any help 

(sry if i did a 2x post couldn t edit first)
Copy code
  1. $("#ImageSrc").attr('src',GetLocalProfilePhoto()); //this working
  2. $('#ImageSrc').width(90); //this working
  3. $('#ImageSrc').height(90); //this working

  4. $(".patientPhoto").css('background','url("'+GetLocalProfilePhoto()+'");'); //this not working
  5. $(".patientPhoto").css('background-size','45px 45px;');  //this not working
  6. function GetLocalProfilePhoto(){

  7. if(window.localStorage.SessionJson){ //testing if i have a photo in storage (stocked it with ajax request before
  8. var LocalUserInfos = $.parseJSON(window.localStorage.SessionJson);
  9. var image = LocalUserInfos.PhotoProfil;
  10. if(image == null) // if the ajax returned nothing i use default picture
  11. return '../images/avatarDefault.png';
  12. else
  13. return 'data:image/png;base64,'+image; //else i use the picture
  14. }
  15. else
  16. return '../images/avatarDefault.png'; //i t s for the case of a bug
  17. }