jslint_com : Message: Re: Does a global variable exist?:

Re: Does a global variable exist? < Prev Next >
Posted By:douglascrock...

Wed Jul 8, 2009 7:02 pm |
...
this.hasOwnProperty(name)

This man's got it.  (Surprise, I know.)

So, if I wanted to see if knockoutjs exists inside of some browser-based javascript code, I'd write...
if (window.hasOwnProperty('ko')) {...

Got it? Good.

Labels: , ,