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
- $("#ImageSrc").attr('src',GetLocalProfilePhoto()); //this working
- $('#ImageSrc').width(90); //this working
- $('#ImageSrc').height(90); //this working
-
- $(".patientPhoto").css('background','url("'+GetLocalProfilePhoto()+'");'); //this not working
- $(".patientPhoto").css('background-size','45px 45px;'); //this not working
- function GetLocalProfilePhoto(){
-
- if(window.localStorage.SessionJson){ //testing if i have a photo in storage (stocked it with ajax request before
- var LocalUserInfos = $.parseJSON(window.localStorage.SessionJson);
- var image = LocalUserInfos.PhotoProfil;
- if(image == null) // if the ajax returned nothing i use default picture
- return '../images/avatarDefault.png';
- else
- return 'data:image/png;base64,'+image; //else i use the picture
- }
- else
- return '../images/avatarDefault.png'; //i t s for the case of a bug
- }
-