Select2 filter not working

I use Select2 to handle my dropdownmenu. The dropdownmenu get's populated via "Ajax-call" to PHP, who get's data from Mysql.  The Select2 dropdownmenu offers serach function and filtering. When i type in something in the search field,...

How to select datalist's description

I have 2 inputs in a form. In the 1st input, I load a datalist through JSON. The json list has 2 attributes machine and lot.   What I want is when the user select a machine, the 2nd input to be filled automatically with the lot. For example If I sele...

Can I toggle specific instances of a class that occurs multiple times?

I'm building a working mockup of a site design and I want the ad spaces to disappear to illustrate what the page would look like if they're empty.  Can I accomplish this without having the uniquely identify each space?  I was hoping this woul...

cross domain issues prevent action when reload parent page

I'm  trying to reload the parent page from another domain. I achieved the reload on parent page when closing the child, but once I reload, the action on onclick event triggers again. My question is how can I prevent window.open once it reloads?...

javascript scope, why does $(this) equal [window]?

I have an ajax function (not sure if relevant) that updates html and creates a few links:  <a href="#" class="clickme" onclick="column_click()" title="my title">click me</a>   I'm not sure why, but oncl...

After add transform scale, I can't set the section to center [closed]

If I don't use javascript to listen the event of resize. Is that any method to center the div?  The css structure contain 3 state. normal , under 900px, under 550px. When the width is over 550px. I can set the section to cente...

“ERROR in loader Users/abc/node_modules/babel-core/index.js?{”presets“:[”react“]} didn't return a function ”

When I'm doing webpack I'm getting into this error:  ERROR in loader Users/abc/node_modules/babel-core/index.js?{"presets":["react"]} didn't return a function   webpack.config.js  module.exports = {   entry: './src/mai...

Okay to demand Javascript?

I know from an historical perspective that it has always been frowned upon to not gracefully degrade when a visitor with Javascript disabled visits a site but how relevant is this now?  I'm asking since an application I'm building is going to...

click on parent except one of its child - jquery

Here is my fiddle link.  I want to do some actions on clicking the parent box, except its one child with class .notClickableCol. I used :not(), but currently it is not working.  It is working when this text ("Not Clickable") is without <sp...

Pass directives through another directive

We created some directives to speed up our coding and clean the htmls, for example:  <div class="form-group">    <label class="form-label">{{label}}         <input ng-disabled="ngDisabled" ng-model="ngModel&...

Javascript How to rotate an image that's in a series of unique id's?

I have a series of images with unique id's. In javascript we can rotate them by id by using JavaScript however, I haven't found a way to allow the user to rotate them individually when I have unique id's attached to them. The unique id...

How to disable vertical scrolling while swiping ion-slide

I'm building an app where I have images inside a ion-slides with indvidual ion-slide tags, when I'm swiping horizontally the scroll bar sometimes activates which moves the page and causes the user to have to re-adjust.  How can I lock the nat...

Appcelerator Titanium JS dosen't parse Date() as expected

I am using Appcelerator Titanium, and I'm trying to parse a date string as a new Date object and then use the .getTime() function but it keeps returning "NaN"  var d = new Date("2014-02-01T00:00:00"); var time = d.getTime(); conso...

JavaScript map - select one property from array with name

I have this array:  [{a: 1, b: 2}, {a: 2, b: 3}, {a: 3, b: 1},...]   and I would like to convert to this array:  [{a:1}, {a:2}, {a: 3}]   I tried this:  array.map(x => {'a': x.a})    but this is a mistake (its giving error). is there any f...

Why does this jQuery image picker work in FireFox but not IE?

Using the jQuery Image Picker plugin from http://rvera.github.io/image-picker/ (which works in IE), placed it on my own site with the following HTML:  <select id="test">     <option value="1" data-img-src="https://www.goo...

Remove div with beautiful animation

I want to remove div with a great animation but I don't know how to do this.  So I make that fiddle for example :  HTML  <h2>What I have</h2> <div class='test'>1</div> <div class='test'>2</div>...

Passing a value from a HTML dropdown to a button to fire up a modal

I'm trying to pass a value which is selected by the dropdown on to a button (data-target) so i can show modals dynamically. I'm generating the modals with PHP so everything will be generated automatically.   So whenever a user selects a dropd...

how to get a source url in jw player withe javascript command

im new in javascript and i try to get a video url from a site using java script  without looking for it in the page source  the page source is like this  <html> <body> <script type="text/javascript"> jwplayer("myJwVideo&...

CesiumJS Rectangle Entity Overlap and Size Issue

My team and I are attempting to develop an application on Cesium that requires circle and rectangle points. We are using the native PointGraphics to make the circles, but are creating entities for the rectangles. The code is shown below:  var entity...

Problems sampling color from image-pixel drawn on off-screen canvas

I need to sample the pixel-color from an image, but it seems like I can't get it right. I load the image and draw it to an off-screen canvas, then I try to sample the pixel-color but I always get 0-values.    My code:  // Create canvas and set co...

Google maps: zoom in/out with panning to specific point like in maps.google.com context menu

I have a project with google maps. I want to emulate maps.google.com context menu with Zoom in and Zoom out actions. The google.maps.Map.setZoom() is zooming map to the center point but in maps.google.com when you right click at the specific point an...

Google visualization AreaChart giving “Invalid Argument” in IE7

I am getting a json string back from an ajax call which I am sticking in a Google visualization AreaChart. I have found that whenever there is only 1 row in the data, GV returns "Invalid Argument" in IE7, but it works in all other browsers....

Keybinds option not working on bootstrap datepicker

I want to change keybinds beahvior for boostrap datepicker.  I did this :  $('#birthday').datepicker({     format: "dd-mm-yyyy",     startView: 0,     maxViewMode: 2,     language: "fr",     autoclose: true,     keyBinds:...

How do I wait for “whenGET” to finish using AngularJS / Karma unit testing framework?

How do I wait for whenGET() or expectGET() to finish using AngularJS's unit test framework Karma / Jasmine?   Unit Test for adminController:  'use strict'; //SETUP describe('spec/controllers/admin.js - adminController', function (...

Refresh WooCommerce Mini-cart via ajax

I'm adding items to the cart via a custom plugin and everything works as i need it to, however the mini cart does not update and i can't seem to trigger a refresh. Here is a piece of my code for reference:  javascript: jQuery.ajax({...

Unable to get value of the property 'indexOf'

I'm using CSS multi-column layout (css3) which of course works fine in Chrome, FF and Safari. But many still use IE9 and we have a requirement to support it.  For IE support I include csscolumns polyfill js from this site.  When this polyfill loa...

NodeJS, custom Content-Type gives empty body

I'm having trouble using "application/vnd.api+json" as content type in NodeJS express app with bodyparser.  My app contains:  const app = express(); app.use(bodyParser.json({ type: 'application/vnd.api+json' })); app.use(bodyParse...

Algorithm page links

I am trying to figure out pagination based on this solution here:  https://stackoverflow.com/a/44844/3214545  I have never really done complex logic so I am having difficulty with it. This is my code:  var allPages = 50; var current = 16; var pageLin...

Record WebCam video using JavaScript

I am trying record video using user's webcam and save video. But when i click record button my javascript code gets following error:  script.js:17 Uncaught TypeError: webCamStream.record is not a function     at startRecording (script.js:17)...

jQuery chosen - on click dont work

I'm using chosen JQuery plugin, i would like when the user click on the select box; do something (load data from data base into the select box).  HTML  <select name="mysection" id="mysection" class="chosen-select-deselect&#...