简体   繁体   中英

How do I enable JS library auto completion in PhpStorm?

In an HTML file, I included jQuery via

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" ></script>

I downloaded the library via the context menu and now see it in the project folder under External Libraries . Yet, it seems jQuery is not recognized.

<script type="text/javascript">
    $(document).ready(function() {
    ..
    });
</script>

The $ is underlined and code hinting asks me to create a function or method called $ . The code itself works though.

What am I supposed to do to make PhpStorm recognize the external JavaScript library?

As LazyOne pointed out in his comment I had to look up settings, and there I realized I had to download the library again, and made it global.

phpstorm的设置

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM