Przeszukaj pomoc

Unikaj oszustw związanych z pomocą.Nigdy nie będziemy prosić Cię o dzwonienie na numer telefonu, wysyłanie SMS-ów ani o udostępnianie danych osobowych. Zgłoś podejrzaną aktywność, korzystając z opcji „Zgłoś nadużycie”.

Learn More

New Html tag values/image src, updated by websocket & JavaScript, don't show on display until physical rotate

  • Nie ma odpowiedzi
  • 1 osoba ma ten problem
  • 18 wyświetleń
more options

I am using websockets to send status update info from my server to my webpage. The websocket data received by the browser is processed by some JavaScript functions and either changes "innerHTML" for a "text" type HTML tag or background image for an HTML button tag. Since FF mobile version 12 (including 16), the tags do not automatically update. A physical rotate of the phone (and hence a screen redraw) WILL show the updated text/image. Automatic information updates worked in FF Mobile version 11. A "redraw fix" found on the web was tried, but did not work. E.g.,:

 // "element" == document.getElementById("Button_id"); 
 // obj.image.state == filename of image based on state
 . . .
  // set tag's bkgd to new uri
  element.style.backgroundImage = "url(" + obj.image[state] + ")"
  // added redraw fix
  var redrawFix = element.offsetHeight; 
  element.offsetHeight =  redrawFix;

Phone is Droid3 running Android 2.3.4. Automatic updates work fine on FF for Windows versions 12-16.

I am using websockets to send status update info from my server to my webpage. The websocket data received by the browser is processed by some JavaScript functions and either changes "innerHTML" for a "text" type HTML tag or background image for an HTML button tag. Since FF mobile version 12 (including 16), the tags do not automatically update. A physical rotate of the phone (and hence a screen redraw) WILL show the updated text/image. Automatic information updates worked in FF Mobile version 11. A "redraw fix" found on the web was tried, but did not work. E.g.,: // "element" == document.getElementById("Button_id"); // obj.image.state == filename of image based on state . . . // set tag's bkgd to new uri element.style.backgroundImage = "url(" + obj.image[state] + ")" // added redraw fix var redrawFix = element.offsetHeight; element.offsetHeight = redrawFix; Phone is Droid3 running Android 2.3.4. Automatic updates work fine on FF for Windows versions 12-16.

Zmodyfikowany przez rboston w dniu