Type mismatch - JavaScript -


I'm running into a problem while trying to use the following code. It is Firefox, Safari, Chrome, and IE Runs perfectly in 9 + 10, but causes the rest of my page to 'crash' while running in IE8. The console error I received is 'type mismatched' and the debugger points to the IF statement line. I am trying to understand it, beating my head against the wall, but there is no benefit. Does anyone have a clue that is happening here?

  function writeIframe11092 () {warning ("first"); Document.write ('& lt; iframe style = \ "position: absolute; left: -40000px; \" src = \ "https: //mydomain.com/images/close.gif \" & gt; & lt; / Iframe & gt; '); Warning ("after"); } If (window.attachEvent) window.attachEvent ('onload', writeIframe11092 ()); Else if (window.addEventListener) window.addEventListener ('load', writeIframe11092 (), incorrect);  

writeIframe11092 () function calls and a value Gives ( undefined in this case), and passes that value to attachEvent .

the writeIframe11092 function is representing itself, you want to use it here.

  if (window.attachEvent) {window.attachEvent ('onload', writeIframe11092); } And if (window.addEventListener) {window.addEventListener ('load', write iframe11092, wrong); }    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -