Comparing a DOM Node wih a DOM Element

I'm having some trouble figuring this problem out. I'm aware that everything in a DOM is a node and that a DOM element is also a node. However, my problem is this: I have a DOM node and a DOM element and I need to compare these to see if they...

Issue with javascript navigation disappearing

I am working on some site changes for a friend (he works at a legal firm) who has a navigation bar on the left side of his website. On hover, these show a submenu. Unfortunately, he tried to take out one of the submenu items and lost all of the funct...

How to hide optgroup data from displaying after select

I want to hide other optgroup (display: none) when main1 is selected by Product X - main2 show only Product X quantity and hide other Y and Z.   <select id="MAIN1" name="MAIN1" onchange="calculate()">     <option sele...

How can we monitor mongoDB queries?

I just wanted to know if there is a possible way to monitor mongoDB queries. I tried with the explain functionality provided by the mongo shell. But it is very hectic to manually track each and every query.  I am using mongoose as an ODM.  The one wh...

Create a circle object with port

I'm trying to create a circle with port, I'm implementing a workflow and I need to create a start circle and an end circle with port, but without success until now.  I can create the circle but without ports, the method getPortAttrs is called...

Dynamically Resize Complex Canvas Path HTML5

I've created a drawing of a truck using paths in an HTML5 canvas. The canvas image itself is close to 900 lines of code and I've implemented a function to draw the image based on a resize ratio determined by the window's width/height. The...

NodeJS is not serializing the ES6 Map

This is my sample javascript code is being executed in node.js  let commutertrip = new Map(); let t = {     userId: 1,     capacity: 4,     commuteId: 1,     endTime: new Date(),     id: 1,     status: "QUEUED",     startTime: new Date(),...

Paper.JS Framework “Selection Outlines”

Anybody know how I can easily customize "Selection Outlines" in paper.js. ". Paper.js draws the visual outlines of selected items on top of my Circle and I want to cutomize the size and color of this outlines. for example:  var myCircle =...

Regex works on browser but not in Node.js

I have a regex: /(?<!\<)\<[a-zA-Z0-9. _]+\>/g. Works fine in browser console if I do "(<<a1>> * <b1> * <c1> * <d1>) * <<e1>>".match(/(?<!\<)\<[a-zA-Z0-9. _]+\>/g).   Same line...

jQuery Chosen: Uncaught NotFoundError: Failed to execute 'appendChild' on 'Node':

I have a problem impossible to solve by myself. I am debugging this for several days but no success in found where is the problem.  I have a chosen.js + jscrollpane.js. When a chosen is open, the search input field must to be focused to write some se...

Cant unit test application with manual bootstrap in AngularJS

my code needs to do manual bootstrap cause requires loading files before laoding application.   var bootstrapModule = angular.module('bootstrapModule', []);    // the bootstrapper service loads the config and bootstraps the specified app   bo...

Why does this jQuery reset method not work correctly?

I have a modal form that is loaded on click using jQuery. There is a reset button in the form that works like this:  $('input#reset').click(function() {         $(':input', '#contactForm')             .not(':submit, :reset...

agGrid AngularJS 1.x examples are not working

During evaluation of agGrid by using AngularJS. I've found that on agGrid Documentation  examples of AngularJS are not working. I've found exception on Internet Explorer console:     Failed to instantiate module agGrid due to: Error: [$inject...

AngularJS 1.7 with ES6 and webpack giving error: Uncaught TypeError: Cannot read property 'module' of undefined

I am creating AngularJS app skeleton. I am using ES6 with webpack for bundling. I am getting an error. I searched around but could not find solution. Error I am getting is:     Uncaught TypeError: Cannot read property 'module' of undefined...

ScriptSharp: myObject.prototype = new myOtherObject;

How can I reproduce this in ScriptSharp (C#):  myObject = function(input) {  }  myObject.prototype = new myOtherObject;...

Full Calendar - MinMax Time+SlotDuration Not Show Hours Column

I'm using fullcalendar v2.9.1 and I would like to show the calendar with slotDuration of '00:90:00' and maxTime: "22:00:00", minTime: "08:00:00".  But the calendar not show the hours in the left column.  When I removed the...

Error using materialize.css (0.97.7) with Aurelia CLI (current version)

The Problem: I am trying to get the materialize.css work with the Aurelia CLI. But what i get is the whole materialize.js as an error output in the console and a part of the hammerjs as well i think.  What i've done The Aurelia cli compiles fine...

Hijacking a CSS definition

I need a JavaScript/jQuery way of "hijacking" a CSS definition that is not based on a class or ID.  An example CSS:  input {     border: 1px solid red; }   If I then have a document with, say, a <span> element in it, I'd want to add...

Lodash filter with limit

Is there a way to filter the first n elements from an array that match a criteria?  I know you can filter and then call take but doesn't that go through the whole list instead of exiting after reaching the limit?  _(books).filter(function(book) {...

document.execCommand in iframe don't work

I'm working on my WYSIWYG editor. And I have code like this:  doc.execCommand(cmd, false, null);   The cmd argument would be 'Bold', 'Italic', etc. And the doc variable refer to the document in the iframe, which is initialized som...

Should't JavaScript ignore whitespace? Node quirk in Firefox

I encountered this "bug" in the latest verison of firefox and I don't know what causes this behavior and which is the correct result.  HTML  <div><h1 id="heading">First Title</h1></div><div><h1>...

Google maps api place_changed event not Firing

I am using google maps API v3 on my ASP.NET MVC project. I want to show a map to the user which could search for someplace on it and then select that place, then submit it (very simple).  Everything is going ok in this scenario, except getting the su...

Is there any problem in my code? (Simple JavaScript find Special Char)

i want to get two msgs when user type special character like [email protected] @[email protected] with the help of charCodeAt();  my code gives an repeated answer if i enter normal text or if i enter spec char it gives my both condition true   var username = prompt("Enter...

Check if the property of a given object exists or not

I'm trying to check if myObj has or not "x" properties. However, is not returning anything when myObj doesn't have the property I'm looking for. Here is the code:   var myObj = {     gift: "pony",     pet: "kitten"...

tinymce custom-button replace content

I added a custom 'quote' button.  ed.addButton('blockquote', {     title : 'blockquote',     cmd : 'mceblockquote',     image : url + '/img/blockquote.gif',     onclick : function() {         var blockquoteActi...

ajax dynamic file viewer

I am having problems trying to get this to work and after hours of trying, it is time to see if someone can give me some points. I would be very grateful.  I am trying to create a very simple dynamic text file viewer (in this case a log file). Entrie...

Idiom to describe possibility of effect

Sometimes I need to write a function that may or may not have an effect.  Is there a functional (or otherwise) idiom to describe this state of affairs? The prefix maybe describes it, but is there something idiomatic?  For example:  function maybe(gua...

How can I add a dot between two numbers?

I'm trying to add a dot between two numbers. It's about article numbers, for now they were like XXXXX or XXXXXX and now should be XXX.XX or XXX.XXX which I can't figure out.  Article numbers are loaded automatically from database since th...

JavaScript negative lookbehind issue

I've got some JavaScript that looks for Amazon ASINs within an Amazon link, for example     http://www.amazon.com/dp/B00137QS28   For this I use the following regex: /([A-Z0-9]{10})  However, I don't want it to match artist links which look l...

Javascript: Sorting an array of objects based on a timestamp property doesn't sort one element correctly

I am trying to sort an array which contains arrays of  two elements of the form [[string, object], [string, object], ...]. Each object has a property named: currentStatusTimestamp. I am trying to sort the internal arrays based on this property. It se...