How do I declare a namespace in JavaScript?

How do I create a namespace in JavaScript so that my objects and functions aren't overwritten by other same-named objects and functions? I've used the following: if (Foo == null || typeof(Foo) !=...

Global Javascript files and naming conventions (unobtrusive Javascript)?

I am trying to reorganize my Javascript into JS files and clear out my js from my html... The way I see if is the following.... I would really like some input or any documentation/information...

Possible to share javascript imports across iframes?

I have a web application that has several iframes that all need to import the same javascript library (eg jquery). Is there a way to only load it once and somehow share that data across all the...

Autoloading of Namespaces i18next

I'm using I18Next as a Javascript-based Translation Solution, and here's what needs to happen: A default namespace "Core" is loaded. It contains most keys I want, but not all of them. There is no...

How do you force your Javascript event to run first, regardless of the order in which the events were added?

I have Javascript that people are including in their page. In my Javascript I have a version of jQuery (1.8 for sake of easy reference) that is sectioned off into its own namespace, and...

jQuery validation engine in Struts 2 not working

My Eclipse Dynamic Web Project structure is as follows: WebContent: CSS (Various css files used) JavaScript (JS files) Pages Page1.jsp Page2.jsp META-INF WEB-INF lib web.xml I'm using...

Unwanted namespaces on SVG markup when using XMLSerializer in JavaScript with IE

I am trying to use the JavaScript DOM API's XMLSerializer to convert an SVG element to its representative markup. This is the basic code used to create the element and serialize it: var el =...

Event Handler Namespace in Vanilla JavaScript

I'm familiar with namespaces in jQuery's event handlers. I can add an event handler in a specific namespace: $('#id').on('click.namespace', _handlerFunction); And then I can remove all event...

TypeScript: Property does not exist on type '{}'

I am using Visual Studio 2013 fully patched. I am trying to use JQuery, JQueryUI and JSRender. I am also trying to use TypeScript. In the ts file I'm getting an error as follows: Property...

Idioms in python: closure vs functor vs object

So I am curious about the views of more experienced python programmers on the following style question. Suppose that I am building a function that is going to iterate row by row through a pandas...

Pass C# Model from View to Javascript

I'm passing this ViewModel to my View: public class DashboardViewModel { public List<UserTask> UserTasks {get; set;} public List<WorkItem> WorkItems {get; set;} } and from...

Javascript: Webpack+Typescript+Namespace (internal module)

We are trying to use Webpack to compile typescript code where we replaced “module” (now defined as external modules) with namespaces (defined as internal modules). This change was done...

TypeScript namespace merging across files

I'm having some issues with getting a namespace across files to resolve and compile properly. According to documentation and this SO answer, the following should produce no...

What is the most pythonic way to reuse data in multiple calls to same function?

Normally I would not ask such a question, but python seems to have 1. an unusual level of community consensus on idioms and 2. tends to encourage them by making them more performant (e.g. list...

Visual Studio 2017, JavaScript intellisense inconsistencies

TL;DR: How do you include a tsconfig.json file in Visual Studio 2017 and still have JavaScript intellisense work like it does by default, giving code hints both for your own code and 3rd-party...

Do I need amazon-cognito-identity-js if I already have the aws-sdk (javascript)?

I have a javascript project where I use the aws-sdk. No I want to use amazon-cognito-identity-js. On the page it says: Note that the Amazon Cognito AWS SDK for JavaScript is just a slimmed down...

How can I access the AST that VSCode creates

I write a VSCode Extension for UI5 JavaScript. The most missing Feature is to have IntelliSense for UI5. Using UI5 typings it will work but not in all. This works: var testvar1 = new...

Cypress Custom TypeScript Command is not a Function

I am implementing a custom Cypress command in TypeScript: // support/commands.ts const login = () => { console.log('Logging in...'); }; Cypress.Commands.add('login', login); declare...

How to copy files between pods or execute in a pod?

I'm trying to execute a terminal command in a pod to get the file content. It works fine on local: const Client = require('kubernetes-client').Client; const Config =...

How to turn on the 'throwIfNamespace' flag in React.js

I have some code like below in my component. <svg id="SvgjsSvg3254" width="318" height="152" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink"...

How to iterate over the namespaces in the metafields using shopify liquid

In the "product.liquid" template, I want to expose all the metafields to my javascript code. Right now I have a namespace called "mystuff", so I did this... // Copy all the METAFIELDS into the...

Using Rails 6, where do you put your “page specific” JavaScript code?

My question here is the same as https://stackoverflow.com/questions/6167805/using-rails-3-1-where-do-you-put-your-page-specific-javascript-code, just for Rails 6 instead of Rails 3.1. Suppose I...

In ASP NET CORE 3.1 with ReactJS.NET how to reference components in multiple .JSX files

Right of the start: I have seen all the posts and have in last few days tryed all their permutations, but this does not seem to work for me. My project is ASP NET Core 3.1. I have followed this...

Making "Objects" In C++ | C++ | JS

So, I'm fairly new to C++ and have been fiddling with it, but fail to see why everyone says that C++ is the object-Oriented version of C. It's true C doesn't have classes, namespaces, etc. unlike...

Laravel + Ratchet: Pushing notifications to specific clients

I am new to websockets and I want to implement such service in my Laravel application. I have already read several posts/pages about this topic, but none explains what I need to do. All of them...

How to constrain type of object keys to namespace constants?

I would like to define a mapped type whose keys are the values of all constants under a namespace. I wasn't able to find other questions that cover this. This question and its duplicate talk about...

Cypress custom commands not recognized by PhpStorm IDE but working in test runner

I use JavaScript files in our Cypress testing. In commands.js I created a custom command: Cypress.Commands.add('selectDropdown', (dropdown) => { cy.get('#' + dropdown).click(); }) And in my...

Autocompletion for VSCode for a module imported via <script src>

Issue description I would like to have Visual Studio Code to hint autocompletion and provide documentation for a JavaScript project which includes libraries a module in a separate HTML...

Is there real documentation for @google-cloud/iot API?

The JavaScript module "@google-cloud/iot" doesn't seem to much resemble its documentation here (https://googleapis.dev/nodejs/iot/latest/index.html). For example, the function...

Upgrade to Visual Studio 2022 Blazor WASM client debugging not working

I am trying to debug my webassembly blazor client. I was previously using VS2019 fairly successfully, except that the breakpoints were unbound till I toggled them off and on again after starting...