redux-form textarea value not updating

I have a redux form with two input fields and one textarea. The input field values are updated for each keypress and the validate function gets the right values. But the textarea keychanges are not reflected in the validate function. Any help ? The e...

How to show upload progress percentage in dropzone.js

I am using dropzone.js in magento to upload files. the progress bar is working fine but i want to show the progress percentage too. Following function is adding style to a span.  uploadprogress: function(a, b) {                 var c, d, e, f, g;...

Merge two sorted arrays into one

Hi I was asked a following question.  Given two arrays i.e. array1 and array2. Both of them contain numbers in sorted order.  Array1 also contains -1 such as; as many numbers in array2 that many -1's in array1.  Example as follows,  array1 = [-1,...

Firefox Sidebar Getting Tab URL

I'm trying to make a quick Firefox sidebar addon, using Simple Sidebar as the base.  I'm getting the current tab URL, and I want it to change in the sidebar automatically, so that when you change tab or URL the sidebar shows the corresponding...

Array.map() vs d3.selectAll().data.enter()

I am trying to understand what's benefit of using d3.selectAll.data.enter() to loop through a dataset and plot it.    var data = [4, 8, 15, 16, 23, 42];    var x = d3.scale.linear()       .domain([0, d3.max(data)])       .range([0, 420]);    let...

Cross origin inside chrome extension

I'm working on an extension that records loading time of web pages inside an iframe. I used the performance timing api to do that. At the beginning I wanted to do that without extension but it was impossible even if I used a proxy and modify on t...

Fire vue method from jquery on click event

I'm trying to append a click event to an already existing dom element.  <div class="logMe" data-log-id="{{ data.log }}"></div> ... <div id="events"></div>   I can't seem to access outside vue me...

SyntaxError: Unexpected identifier with axios

I am trying to use axios as following:  import axios from 'axios';  axios.post("http://localhost:3000/test", {"prop1": "value"}, {headers: {'X-Custom-Header': 'foobar'}})   then the compiler complains:...

How to Get total frame count from YouTube video [closed]

I have a YouTube video length is 5 min, how i get 10 seconds video frame total count number? Video frame will count starting from 0 to 10 second.  Edit - Is there are any Code for download YouTube video for first 10 seconds only?  Please write your...

Using FTGL with Emscripten

I am trying to build a project(logstalgia) with emscripten, but the project requires the ftgl dev libraries (libftgl-dev). I have been searching around for the correct way to link this library so I can run shell> emconfigure logstalgia/configure,...

how to change the array [1,2,3,4] to [1,3,4]

any simply way ?  this is my code:  var a=[1,2,3,4]         a.slice(0,1)         alert( a)   and it print [1,2,3,4]  thanks...

Keeping track of memory usage in javascript

Is there a way in javascript to keep track of memory used by an application? I am not thinking about browser extensions used to debug memory leaks etc, but to let an application keep track of it's own memory consumption, to be able to make a qual...

how to wait with setTimeout until a variable get loaded and, at the same time, receive HTTP requests!

I' ve made a in JavaScript function to check every 100 ms if a global variable is loaded. When the variable will be loaded the function will return the value of the variable as shown below. In my code I use an HTTP server in JavaScript, and the v...

Printing embeded PDFs in chrome

So I think Chrome and Firefox interpretation of DOM is screwing with me. I am trying to print a pdf from a browser (dynamically created) because I can't have the header and footer normally printed with printing an HTML page. Now I was just sendin...

A JS exception caused by 'form' element

Today I ran into this problem and it annoys me a lot... I'm maintaining a JS project and there's a line:  node.tagName   where node.nodeType is 1. Obviously the code wants to get the tag name of this element and it seems to work fine for 99.9...

TypeError: self.parent.parent.context.parseInt is not a function

I'm trying to assign height to a img using ngStyle and for that I'm calculating height with some Math operation as follows:  <div [ngSwitch]="tbNm?tbNm:'itm0'">     <ion-list *ngFor="let vl of scrnshot;let ind=ind...

Copy all files but ignored in .gitignore

I want to copy all files to another dir (with grunt-contrib-copy) except files that are listed in .gitignore. This is my current setup: .gitignore:  /vendor /node_modules   package.json:  {   "name": "grunt-cpy",   "version":...

I want to combine first function to the second one, so I can call it only once

I want to combine first function to the second one, so I can call it only once. Basically i have 2 html5 audio files that im playing. Everything works fine.But if i play my first audio and during that time if i click the second audio the pause button...

Ladda spin animation keeps spinning for one second after stop()

I'm using ladda spinner like this:  var l = Ladda.create(document.getElementById('ladda-test')); l.start(); l.stop(); console.log('ladda is stoped');   My problem is that after l.stop() is executed, the animation does not instantl...

Where are importScripts files loaded from?

The MDN definition is pretty short:     The importScripts() method of the WorkerGlobalScope interface imports one or more scripts into the worker's scope.   When using importScripts("foo.js"), where is foo.js loaded from? I would like to...

How to detect when pdf is loaded in iframe when browser requests partial content range requests?

I want to detect when a pdf has loaded, but the jQuery .load() event never fires when the browser requests the pdfs with partial content range requests in Chrome 40.  I want to trigger the browser print() function once the pdf has loaded. If the pdf...

IE11 error, Object doesn't support property or method 'defineProperty'

Ok peep's so I have this code, but here's a simplified version:  <!DOCTYPE html> <html>     <head>         <title>_</title>         <meta content="text/html; charset=utf-8" http-equiv="Content-Type...

socket.io - weird behavior while reloading page

Hello everyone,  I have a very simple javascript web application that connects to a socket.io service. Everything is working as expected in Chrome, however I experience slightly  different behavior in Firefox.  What seems to be the issue? Well , it&#...

Play Framework requirejs Error: Error: paths fallback not supported in optimizer

I use Play 2.3.7 and get the following error:  [info] Error: Error: paths fallback not supported in optimizer. Please provide a build  config path override for jsparticipantroutes   It appears just on prod mode with ./activator start. In dev mode eve...

Hooking into component

I’m trying to create a chart reusable component, but I can’t wrap my brain around it.  The idea is to reuse the following SVG using react (let’s call it “Axes”), together with some functionality and state like width and height, data?coordin...

Fancybox “dances” around

So I'm having this trouble with FancyBox where when the body of the page (main page) is being scrolled, the box shifts position to the left and top randomly.  Attached a GIF to demonstrate the issue:    I'm using Fancybox v2 as far as I know....

Google Chart - different backgrounds depends on x axis

I use google chart and on x axis I have days of week and on y axis some values. I want to change background for weekends. It is possible in google charts?   I mark on screen field that should have different color:...

show element when clicked and hide again when not active

I have set up a JSFiddle and I am trying to show and hide some text. When you click on any of the "staff" elements and after the animation I have finishes, the text I have within each of the classes shows. When the user then clicks the "s...

Timezone America/Montevideo

If I compute the current local time in Montevideo with the following code:  var dt = new Date().toLocaleString("en-US", {timeZone: "America/Montevideo"}) console.log(dt);   I get:     11/29/2015, 9:46:10 AM   If I check this time on t...

IE 11 AngularJS error - Object doesn't support property or method 'from'

In my JavaScript I have a function detectEnvironmentAndGetLEAndDepot() which is called onload via HTML.  I'm working with wicket, and need to take values held in the back-end, so I fire them to the screen, hide them, and search the <span> v...