Community Forum

factory.printing sometimes returns undefined

Profile Image 1 Posts 1 Karma
tafandi posted this 13 September 2017

Hi I just started trying this (using the free version)

Using IE's F12 Console, if I check factory.printing sometimes it returns the object, but some other times (in other PC or even other tab) sometimess it just returns undefined.

What am I doing wrong? 

FYI my version is IE11

The code is as simple as this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<object id="factory" viewastext style="display:none" classid="clsid:1663ed61-23eb-11d2-b92f-008048fdd814" codebase="/v3/~f/_inc/client/,0,0,56"></object>
    function getfactoryprinting() {
      var f = document.getElementById("factory")
    window.onload = function() { 
      setTimeout(getfactoryprinting, 3000); 
Profile Image 183 Posts 183 Karma
Jerry posted this 14 September 2017

If this were my code I'd lose window.onload in favor of a <body onload call, and forget the timeout.


A body onload event shouldn't be called before a document goes complete anyway.

Post Edited 14 September 2017