简体   繁体   中英

JavaScript intellisense not working correctly

On my visual studio code and visual studio(ide) in javascript file intellisense working not correctly rather intellisense opening but not showing properties or methods only showing history what I've typed into the js file, screen: https://pastenow.ru/67UPL . Code working, event have keyCode property but I can't see this property in intellisense. I tried on dreamveawer, jetbrains rider - event has keycode property and other method properties.

How do I solve the problem?

js file:

function KordinatlariGoster(event) {
    document.Kordinatlar.txtX.value = event.clientX;
    document.Kordinatlar.txtY.value = event.clientY;
}

html file:

<html>
<head>
    <title>4N71K</title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="css/Main.css" />
    <script src="scripts/script.js"></script>
</head>

<body onMouseMove="KordinatlariGoster(event)">
    <form name="Kordinatlar">
        <label>X oxu : <input type="text" name="txtX"></label>
        <label>Y oxu : <input type="text" name="txtY"></label>
    </form>
</body>
</html>

As JavaScript is weakly typed language and thus the interpreter cannot know before hand what will be present in an Object or the type of the object, so it cannot provide proper suggestions using intellisense. While we strongly typed languages such as java, kotlin etc; the intellisense can know the members of the Object and provide with suggestions.Hope this helps

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