I do not speak English, sorry for the mistakes. I’m using bootstrap, jquery, propeller.in and https://github.com/ChadKillingsworth/geolocation-marker I have the following code The problem is that the map does not load inside the div, if I put out the modal content it works normally, I would like to find…
Tag: javascript
Angular 2/4 String Comparison with Ignore Case
I’m comparing a number of fields in an Angular 2 template and it works for same case properties but returns false for the same string on different cases. Is there a way to make it case insensitive perhaps through a simple pipe? Answer You should use === with toLowercase()
Calling Promise.all throws Promise.all called on non-object?
I’m trying to return promises from a promise and run Promise.all like this: How can I use this kind of Promise.all. I know .then(promises => Promise.all(promises)) works. But, just trying to know why that failed. This happens with Express res.json too. The error message is different, but I think the …
Communicate between two pages / tabs
I’m wanting a JavaScript file to control two HTML files simultaneously. That’s page one. Next is page two. And here is the JavaScript: Page one is working, page two isn’t. I’ve been trying for a day to get pages talking to each other, without success. I’m not sure I understand ho…
make d3 force static layout more quickly
I am new in d3js. I rendered a graph ~10000 nodes. I used web worker and static force render ( because normal render is costing more than twice than the web worker). When the range was 10000, it will cost almost 20 seconds, you can see it at console, so how to reduce this times? jsfiddle Answer You are lookin…
In JS can I require() only an export from a module?
In other words can I do this : with a require() statement ?? The above code needs to be in a small module I have to write so I cannot use import Answer
XMLHttpRequest.onload constructor in Javascript?
When making a new XMLHttpRequest, like so There is a method (property ?) called onload. My question is, why we can assign a function to it? like this If onload is a property in XMLHttpRequest, the value of it will change when we assign a new value to it, like a function, right? What is the XMLHttpRequest.onlo…
How to check if key exists in array of object
I am trying to find out if the given key exists in array of object. if the value key exists then i want to return true else false. i giving input of key from text box and then checking if the key exists in array of objects, but i couldn’t get it. here is what i have tried code: if
How to close the first menu collapse when the second one is open?
I have a site built with “Drupal 8” and “Bootstrap 3”. I created in the header, a menu collapse on the left and a menu collapse on the right. How to close the first menu collapse when the second is open ? And vice versa ? Here are the two menus : What should I add to my JS file.
Checking if a state object is empty
I have a react js state object and would like to execute some code if the object is empty. Is there something wrong with my logic because the code inside the if block is not getting executed. Answer Given that this.state.errors is an object you can do this, Object.keys will return an array or all the keys fro…