Jump to content

Implied Global Document - Jslint


madsovenielsen

Recommended Posts

I really dont know... how do i make document. local ? putting it in a local variable ? what is the best way ??/mads
If you made it local, it wouldn't have the getElementById() method. You actually do want your document variable to be global.If you really did want to make a local document variable, you would use the var keyword:
var document = new Object();

Link to comment
Share on other sites

If you made it local, it wouldn't have the getElementById() method. You actually do want your document variable to be global.If you really did want to make a local document variable, you would use the var keyword:
var document = new Object();

Okay. i understand. but why does JSlint think having a global document. is an error ?to avoid name collisions ?/mads
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...