LG electronics world wide undefined



  •  

    wtf is that undefined on the right?

     (i am viewing with firefox 1.5)
     



  • From the looks of the page, the "undefined" comes from an external .js file (/js/embedControl.js) which contains only:

     function __ShowEmbedObject(__ELEMENT_ID)

    {
    document.write( __ELEMENT_ID.text );
    __ELEMENT_ID.id = "";
    }



    and the element they're passing in (__GATEWAY__) isn't defined anywhere, so... undefined. 

     

    Viewing the page in IE shows there's a <comment> block with that ID just before the flash applet, and works "fine" there.



  • Using Firefox: highlight 'undefined', right-click, "View Selection Source." (Which just confirms what the previous poster said.)


    It was some time before I discovered Firefox had such a feature. It had been on my 'wish list' in a browser for a good long while. 



  • It appears to be generated by the line:

         <SCRIPT>__ShowEmbedObject(GATEWAY);</script>

    when I look in:

          <SCRIPT language="JavaScript" src="/js/embedControl.js"></SCRIPT>

    I see:

          function __ShowEmbedObject(__ELEMENT_ID)
         {
             document.write( __ELEMENT_ID.text );
             __ELEMENT_ID.id = "";
         }

    there is a tag:

         <comment id="GATEWAY">

    My WAG would be that IE is passing the object representing the comment tag to the function while Firefox is not.  The message from Firefox's JavaScript console is:

         Warning: Element referenced by ID/NAME in the global scope. Use W3C standard document.getElementById() instead.
         Source File: http://www.lge.com/
         Line: 36

    Is "GATEWAY" some kind of global variable in IE?

     

    Bernie



  • A Google search suggests it isn't.

     

    I suspect that FF returns "undefined" when the not-explicitly-defined .text property is queried, whereas IE returns something else.

     



  • It was even longer before I learnt fx did that. Ie just now reading that post.


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.