'Document' is unresolved?

Greetings.
I have been indundated with warnings in the IDE inspector.
They are all 'unresolved variable'.  I saw other posts on how to create a root level file to define them for things like JSON layouts.

But these are the most basic things like 'document', 'console', 'alert'... etc.

I really cannot see creating a reference document that defines *every single* parameter or function for things like this.  Knowledge of these classes and functions should be fundamental.  I am using simple things like 'createElement' or 'cookie'.
(If I simply declare a 'document', it still warns me that 'createElement', 'appendChild', 'cookie', etc are not resolved... )

And since I can't find anyone else who is complaining about the problem, I assume I just have some setting wrong or not correctly defined.

(Example code fragments are below, underlined where the inspector is complaining. They are a mix of JS and JQuery, becuause I am still trying to understand JQuery)

Can anyone advise on how to eliminate these inspection messages?

-Scott

$(document).ready(function() {
          /*  yada, yada, yada  */

}


function CreateDropDown() {
    var div = $('#AreaForDropDown');


    console.log( " Message... ");

    var selector = document.createElement('select');
    selector.id = 'ID_NAME';
    var option = document.createElement('option');
    option.text = '';
    selector.options.add(option);

  /* yada, yada, yada... more options */

    div[0].appendChild(selector);
}


  

2 comments
Comment actions Permalink

Hi there,

1) Please try "File | Invalidate caches..." and IDE restart first

2) See what you have in "Settings (Preferences on Mac) | JavaScript | Libraries" -- maybe some of the core libraries are disabled.

0
Comment actions Permalink

Option #2 solved it - Thanks!

They were all disabled, by default.  Ever since I installed it a few week ago.  I don't know why that is the default.

The app is so vast, I'm not sure I can find everything.  Or what all the settings mean when I do find them.

Thank Heaven for the forum.

-Scott

0

Please sign in to leave a comment.