0

I tried jQuery.isFunction(document.write) in IE8 and it returned false.

These are a few things I noticed. 1. document.write.constructor is undefined 2. typeof document.write is object

I came to know this issue when creating a stub on document.write using Sinon which threw an exception saying Attempted to wrap object property write as function

Though, I can workaround this issue, by bypassing the check for document.write specifically, but I just wanted to know whether its a bug in JQuery or its intentional(though it seems not).

Also, I checked the JQuery code and its a simple check $.call(a) === "[object Function]" which fails in case of IE8(most probably other versions).

One more thing, why can't we just check whether call function of document.write is defined and native? This should suffice or not?

Hariom Balhara
  • 832
  • 8
  • 19

1 Answers1

0
  1. Take a look here , this question was discessed at msdn forum.

  2. And here why-dhtml-behavior-not-work-in-ie8-if-document-write-is-executed-in-head

Community
  • 1
  • 1
Anton Baksheiev
  • 2,211
  • 2
  • 14
  • 15