0

my problem show only in IE and only when I connect the first time, when I refresh the page the images are shown!!! my page is build with the script of jQuery on the top and after that the html.

        <div id="statusbar" >
        <img class="statusbar_phone" />
        <img class="statusbar_text"  />
        <img class="arrow" style="display:none" src="//expertsimages.liveperson.com/images/phonewidget/arrow_up.png" />
    </div>

the first two images should get the right image from a service.

      function InitExpertStatus() {
         service.GetExpertStatus(function (data) {

             $('.arrow').show();

             switch (data) {
                 case "online":
                     {
                         SetStatusAvailable(true);
                         InitPhonNumbers();
                         break;
                     }
                 case "offline":
                     {
                         SetStatusAvailable(false);
                         InitPhonNumbers(data);
                         break;
                     }
                 case "busy":
                     {
                         $('.phone_status').text("You are busy.");
                         $('.set_numbers').text("You can only switch phone numbers when you're not busy. Please try after your chat or phone session is over.");
                         $('.set_numbers').css('color', '#FF7E00');
                         $(".statusbar_phone").attr("src", "//expertsimages.liveperson.com/images/phonewidget/phone_red.png");
                         $(".statusbar_text").attr("src", "//expertsimages.liveperson.com/images/phonewidget/txt_busy.png");
                         $("#phoneIDMessage").hide();
                         HideNumbers();
                         break;
                     }
                 case "blocked":
                     {
                         HideNumbers();
                         $('.set_numbers').hide();
                         $('#editNumbersLink').hide();
                         $('#contactUs').show();

                         $('.phone_status').text("Your account has been blocked.");
                         $('.phone_status').css('color', '#FF0000');

                         SetStatusAvailable(false);
                         break;
                     }
                 default:
             }
         });
     }

     function SetStatusAvailable(isAvailables) {

     if (isAvailables) {
         $(".statusbar_phone").attr("src", "//expertsimages.liveperson.com/images/phonewidget/phone_blue.png");
         $(".statusbar_text").attr("src", "//expertsimages.liveperson.com/images/phonewidget/txt_available.png");
         $("#phoneIDMessage").show();
     }
     else {
         $(".statusbar_phone").attr("src", "//expertsimages.liveperson.com/images/phonewidget/phone_red.png");
         $(".statusbar_text").attr("src", "//expertsimages.liveperson.com/images/phonewidget/txt_notavailable.png");
         $("#phoneIDMessage").hide();
     }

     $('#contactUs').hide();
 }

any suggestions :)

shaharnakash
  • 675
  • 3
  • 11
  • 39
  • can you create a fiddle for this? – reggaemahn Sep 16 '13 at 09:26
  • What does mean '//' in the image source attribute? – Reporter Sep 16 '13 at 09:27
  • @reporter, it's so you don't need to have `http://` or `https://`... it will continue in the same protocol as you're currently on. [See this answer](http://stackoverflow.com/a/3583129/930393) – freefaller Sep 16 '13 at 09:30
  • @freefaller thanks. I had never seen it before. – Reporter Sep 16 '13 at 09:31
  • `/expertsimages.liveperson.com/images/phonewidget/txt_notavailable.png` "/" symbol is used single time, "\" is used double time. – bhawin Sep 16 '13 at 09:53
  • I cant put it on fiddle because its used in services from the server – shaharnakash Sep 16 '13 at 10:43
  • its seems that the script doesnt load in the load at first time – shaharnakash Sep 16 '13 at 10:54
  • Which version of IE specifically are you using? Does the problem go away if you use the protocol in the URL? (IE8 has problems with script-generated HTML and relative URLs; they tend to resolve to about://whatever.jpg instead of the proper protocol/domain) – EricLaw Sep 16 '13 at 18:57

0 Answers0