long-time lurker, first time poster – I am trying to query SQL Server and populate a drop down using the onload event but I am getting 2 errors in my browser console: Uncaught TypeError: Failed to resolve module specifier "mssql". Relative references must start with either "/", "./", or "../". Uncaught (in promise) ReferenceError: queryDb ..
Category : import
I’m trying to export functions and change variables of 2 js code. I’m currently working on a project and I need to make sure user is logged in before he can access content I made two html one for main and one for login. first Code looks like this: import status from ‘/login.js’; const addhotel ..
so I’m currently developing my first multi page website and I’ve run into a dilemma. So, I am trying to integrate JavaScript into each of my pages, but I’m not sure what to do and not to do. I’ve been told that putting the event listeners on the main JavaScript file for the given page ..
I would like to debug a single JavaScript file with absolute import implemented in my project. Open file and press F5, and all the imports set. Coming from C++ background, project uses absolute imports, thus relative imports are confusing. If it would help, this is a Nuxt-Express template app, and I’m working with Yarn. I ..
I Have changed the import type of Javascript to "Module" and after this change , the bootstrap table’s data-formatter attribute is not able to recognize my function present inside the module. <th data-field="status" data-formatter="capitalize" data-sortable="true">Status</th> . . . <script type="module" src="{{ url_for(‘static’, filename=’sample.js’) }}"> </script> In Sample.js import {hello} from "./main.js" function capitalize(value) { const ..
I’ve read countless articles on StackOverflow about this, but i couldn’t quite find the answer for my problem. The closest answer i’ve found was this (How to import CSV file into HTML form, and export HTML form to CSV file) but it still didn’t solve my problem. I’ve wrote some code for a survey that ..
I’m trying to develop a chrome extension that will be using an npm package, more specifically, ‘yt-search’. I have tried to go at this both manually and using some available tools such as generate chrome extension and extension-cli, both of which are supposed to automate the process and add the capability of using node-modules. However, ..
I would like to import a file/bundle that is running on a different port(3004) and import it into another repositorie folder that is running on localhost 3002. It there an easy way of doing this? //index.js or any other file name import myService from "http://localhost:3004/myFeatureAppService.js" This is the error I’m having: Module not found: Can’t ..
I am trying to understand how to import a class in a .js file into another so that I can run an async function within the class imported. //file called helloworld.js class helloworld { async greetings(){ console.log("hello world") } } export default helloworld; I am attempting to use the async function called greetings in the ..
I’m learning Electron, creating a simple 3D visualiser based on three.js. I stumbled upon an issue: the guide I’m following (here) copypastes the three.js library inside the project directory and includes it in the main HTML file with a script tag. Coming from a Python background this strikes me as very annoying since: I’d need ..
Recent Comments