2

So my jquery (1.4.1) code is something like this:

$(document).ready(function () {  
    $("#Pattern").focus();  
    $("textarea").change(function () { Match(); });  
    ...  
    var Match = function () {
             ...
          };  
  })

Pattern is a textarea. And all works fine everywhere - except IE 8. And behavior of IE 8 is weird - it doesn't work sometimes for the first time and seems to work later. By not working I mean when I type something in textarea and lose focus - Match function is not called. I looked around but all I tried was in vain.

EDIT: solution

So, nothing worked and I had to do it by hand using .focusout event

    var previousPattern = '';
    $(document).ready(function () {
        $("#Pattern").focus();
        $("#Pattern").focusout(
                function () {
                   if ($("#Pattern").val() != previousPattern) {
                      previousPattern = $("#Pattern").val();
                      Match();
                   }
                });
       ...
    }

And now it works as expected.

PeeHaa
  • 71,436
  • 58
  • 190
  • 262
ren
  • 3,843
  • 9
  • 50
  • 95

1 Answers1

0

Twitter seems to use "input" and "change" - it's non-standard. Try binding the element via .bind() and check, if it is really bound.

Community
  • 1
  • 1
buschtoens
  • 8,091
  • 9
  • 42
  • 60