javascriptc#jqueryinternet-explorer-8ie8-browser-mode

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


I've got this 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);
    };
});

...and this related C# code-behind:

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);

...which works fine in Chrome (the textbox is upwardly mobile / grows vertically as text is entered, to display all the text):

enter image description here

In IE, though (Browser Mode = Internet Explorer 8, which is apparently the standard mode users here will see), it doesn't work:

enter image description here

(there are more lines of text in that textbox, but they don't display).

Is it possible to tell IE to straighten up and fly right, or are IE users doomed to have a statically-sized textbox?


Solution

  • jQuery 2.x supports IE9+

    jQuery 1.x supports IE6+

    I'm going to assume you are only using 2.x since your code doesn't work in IE8.

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