keat

Members
  • Content Count

    1
  • Joined

  • Last visited

  1. Hi, i want to pass value from the HTML element to the type script variable , but when i write this.ShowMs(show), it show error of "Property 'ShowMs' does not exist on type 'HTMLElement'. Anyone know what i missing? Below is the code. ping():void{ var intStartTime; intStartTime = +new Date(); var objIMG = new Image(); var show; objIMG.src = this.url + "/" + intStartTime ; objIMG.onload = objIMG.onerror = function() { var delay = Number(new Date()) - Number(intStartTime); show = (delay<1)?("<1"):(" = "+delay); console.log( " Ping" + show + " ms"); this.ShowMs(show); } } ShowMs(passData:any):void{ if(passData < 100){ this.txt.color = "#3FFF00"; this.txt.text = passData; }else if(passData < 300){ this.txt.color = "#C5FF0D"; this.txt.text = passData; }else if(passData > 300){ this.txt.color = "#FF0000"; this.txt.text = passData; }else{ this.txt.color = "#FF0000"; this.txt.text = passData; } }