有什么方法可以让这个 jQuery 在 IE8 中工作吗?

Is there some way to get this jQuery to work in IE8?

我知道了 jQuery:

$(document).on("keyup", "[id$=explainPaymentTextBox]", function (e) {
    console.log("explainPaymentTextBox keyup reached");
    while ($(this).outerHeight() < this.scrollHeight + parseFloat($(this).css("borderTopWidth")) + parseFloat($(this).css("borderBottomWidth"))) {
        $(this).height($(this).height() + 1);
    };
});

...以及此相关的 C# 代码隐藏:

boxPaymentExplanation = new TextBox()
{
    CssClass = "dplatypus-webform-field-input",
    ID = "explainPaymentTextBox"
};
boxPaymentExplanation.Width = 660;
boxPaymentExplanation.Style.Add("TextMode", "MultiLine");
boxPaymentExplanation.TextMode = TextBoxMode.MultiLine;
this.Controls.Add(boxPaymentExplanation);

...在 Chrome 中工作正常(文本框向上移动/随着输入文本垂直增长,以显示所有文本):

虽然在 IE 中(浏览器模式 = Internet Explorer 8,这显然是此处用户将看到的标准模式),但它不起作用:

(该文本框中还有更多行文本,但未显示)。

是否可以告诉 IE 直起身向右飞,还是 IE 用户注定要有一个静态大小的文本框?

jQuery 2.x支持IE9+

jQuery 1.x 支持IE6+

我假设您只使用 2.x,因为您的代码在 IE8 中不工作。

https://jquery.com/browser-support/