<p>How can i check in JavaScript if a variable is defined in a page? Suppose I want to check if a variable named "x" is defined in a page, if I do <code>if(x != null)</code>, it gives me an error.</p>

try to use
undefined
```
```
if (x !== undefined)
```
```
This is how checks for specific Browser features are done.