views:

490

answers:

3

What does this JavaScript do exactly?

parent.kill = 1;

This is used in a project I'm working on to do some sort of session expiration but I've never seen it before. It's loaded in an iframe so I'm assuming that it is targeting the DOM document.window.

A: 

I don't think that's part of the language - maybe part of a library?

mmcglynn
+5  A: 

The child iframe is setting the variable kill in the parent window's global scope. What the parent does with that variable cannot be determined from just that line of javascript.

Crescent Fresh
In other words, "kill" is not a standard property and so has no defined behavior.
Ben Blank
+1  A: 

to piggy-back off @crescentfresh's answer, here is a list of reserved keywords.

geowa4