I am experencing a very odd javascript error that I can't figure out how to get rid of. The following code throws an exception saying "'options' is not defined" on line 29. As you can see, the object is defined (or should be...), and it is being used without exceptions on the line right before, in the middle of an array initializer.
The output from the console.log()
call on line 24 is shown below the code. I have cleared the chache to make sure the browser is not running an old version of the file. This is visible in both Chrome and Firefox/Firebug consoles.
Can anyone explain this?
10 var options = $.extend({
11 windowName: 'NCVIB',
12 width: 1010,
13 height: 660,
14 toolbar: false,
15 location: false,
16 directories: false,
17 status: true,
18 menubar: false,
19 scrollbars: true,
20 resizable: true,
21 copyhistory: false
22 }, popupOptions);
23
24 console.log(options);
25
26 var features = [
27 'width=', options.width,
28 ',height=', options.height,
29 ',toolbar=', opitons.toolbar,
30 ',location=', opitons.location,
31 ',directories=', options.directories,
32 ',status=', opitons.status,
33 ',menubar=', options.menubar,
34 ',scrollbars=', options.scrollbars,
35 ',resizable=', options.resizable,
36 ',copyhistory=', options.copyHistory
37 ];
Console output:
Object { windowName="NCVIB", more...}
Expanding the object by clicking it yields a list of all properties. All the above properties are in the list, and none are set to undefined
.