0

Target.window is null

Hi, I am getting an error, " Type Error : Target.window is null" Any idea what might be the problem?

by
3 Replies
  • QUOTE (Wei loon Ang @ Apr 10 2011, 06:41 AM) <{POST_SNAPBACK}>
    Hi, I am getting an error, " Type Error : Target.window is null" Any idea what might be the problem?

    The following causes the same error. Observe:

    CODE
    var Target = {
    window: null
    };

    Target.window.location = "top";

    01:03:24:567: [T:8326] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    WE 01:03:24:567: [T:8326] ERROR!ERROR!ERROR!ERROR!ERROR!
    WE 01:03:24:567: [T:8326] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    WE 01:03:24:567: [T:8326] Ben's Test [com.yahoo.widgets.tv.test]
    WE 01:03:24:567: [T:8326] TypeError: Target.window is null
    WE 01:03:24:567: [T:8326] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    WD 01:03:24:567: [T:8326] Script execution failed
    0
  • QUOTE (Benjamin Toll @ Apr 10 2011, 08:27 PM) <{POST_SNAPBACK}>
    The following causes the same error. Observe:

    CODE
    var Target = {
    window: null
    };

    Target.window.location = "top";

    01:03:24:567: [T:8326] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    WE 01:03:24:567: [T:8326] ERROR!ERROR!ERROR!ERROR!ERROR!
    WE 01:03:24:567: [T:8326] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    WE 01:03:24:567: [T:8326] Ben's Test [com.yahoo.widgets.tv.test]
    WE 01:03:24:567: [T:8326] TypeError: Target.window is null
    WE 01:03:24:567: [T:8326] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    WD 01:03:24:567: [T:8326] Script execution failed





    Thanks, it gave me a brief idea of whats my error but I am still a bit lost.. So just to confirm, in this case, the error is caused because Target.window.location is null. Is it right?
    0
  • QUOTE (Wei loon Ang @ Apr 16 2011, 10:55 PM) <{POST_SNAPBACK}>
    Thanks, it gave me a brief idea of whats my error but I am still a bit lost.. So just to confirm, in this case, the error is caused because Target.window.location is null. Is it right?

    No, it caused an error because you're trying to lookup a property on another property whose value is null. In other words, it caused an error because Target.window is null.
    0

Recent Posts

in Getting Started / Beginners - Yahoo! TV Widgets