Tagged Questions
JavaScript (not to be confused with Java) is a dynamic, weakly-typed language used for client-side as well as server-side scripting. Use this tag for questions regarding ECMAScript and its various dialects/implementations (excluding ActionScript and Google-Apps-Script). Unless another tag for a ...
0
votes
0answers
2 views
Phaser.js why overlap doesn't work?
I created a little scene on phaser.js
When enemy shots me I have to die but it doesn't work
And also when I shot enemy they should die. I wrote overlap function in code but it doesn't work.
...
0
votes
0answers
7 views
How do you push multiple elements from an array to create two new (unique) arrays?
If I have an array of elements, how do I push multiple elements from that array to create two new arrays that do no share the same elements?
0
votes
0answers
4 views
JSON beginner - when to use JSON?
When I want to exchange data between client and server, I did not use JSON.
If I send data from PHP to Javascript, I do it like this...
<script>
var foo = <?php echo $phpfoo; ?>;
</...
0
votes
0answers
4 views
Angular lazy load js file from partial view
I have a js file in my partial view. How would I load it dynamically when that partial is loaded?
My directory structure is
app
---css
------style.css
----js
-------app.js
...
0
votes
0answers
13 views
How to use multiple if statements inside append() jquery
I am returning a json response from the server. In the JSON response keys will have value eiether "yes" or empty value "". With laravel i can generate using blade if statements. Since it is a json ...
0
votes
0answers
3 views
ThreeJS Maya like wireframe implementation
I'm trying to implement a wireframe which displays quads instead of tris using this code
var geo = new THREE.EdgesGeometry( _this.geometry ); // or WireframeGeometry
var mat = new THREE....
0
votes
0answers
5 views
vue.js: toggle css class onClick in child component
I am new to vue.js.
I have a grid of divs (two nested vue.js components). I want to toggle the css class of a div if the user clicks on the grid.
My idea is to toggle a boolean isMarked on grid ...
0
votes
0answers
4 views
Three JS object is rotated
I make a simple game where you can place objects at the raycaster position when you click on a big plane.
When the mouse is moving a rectangle(helper) follows the mouse(raycaster) and the rectangle(...
0
votes
0answers
5 views
Drop Folder in Chrome (55)
I am trying to load a folder via drag & drop from the desktop.
The attached code reports the following error when type.isDirectory.
error ** A URI supplied to the API was malformed, or the ...
0
votes
0answers
4 views
Igonre some links with Barba.Pjax.preventCheck
I need to ignore barba.js on some links and I know about .no-barba, but I can't add this class to that links.
The links looks like this:
<a href="/shop/0-0-0-4-13"></a>
So I need to ...
0
votes
0answers
12 views
payroll system attendance database table for each month
I am creating a payroll system
where we put in the the number of days present at the end of the month
and it gets added to the database.
at present I have one table with all employee details such as ...
0
votes
2answers
11 views
angularjs $rootscope event does not fire on parent directive
I have two directive on my design.
var app = angular.module("app",[]);
app.directive("dirContainer", function($rootScope){
return {
template: "<div><clock></clock></...
0
votes
0answers
6 views
Always getting ECONNRESET while returning the promise
I am stuck in this problem where I always get an ECONNRESET whenever I return from the then function. If I do console.log(d) it displays the scrapped html data but if I do return d; it always displays ...
0
votes
0answers
18 views
Javascript search string using array
I am trying to search the text of a body of a webpage against a list of predefined words in an array. Then record how many instances of each word appeared.
<script>
var str = document.body....
0
votes
0answers
13 views
How to decrement church numeral in JavaScript?
I'm tring to implement function only FizzBuzz from Programming With Nothing article, I have this numerals (Using ES6 arrow functions):
ZERO = p => x => x
ONE = p => x => p(x)
TWO = p =>...
1
vote
0answers
16 views
Affect translateX number as browser window scales down?
I am using css
position: relative;
left: 50%;
transform: translateX(-50%);
to horizontally center an image <img>.
Is there a way to gradually increase the translateX number as the window is ...
0
votes
0answers
6 views
Add UI-Grid Gridmenu button tooltip
How add UI-Grid GridMenu icon tooltip (uib-tooltip or custom style tooltip).
enter image description here
0
votes
0answers
16 views
updateURL: false, does not work
I am having a problem with my single page website, since I don't want the url of each section to show up. Unfortunately, the command doesn't work, but the others, like offset, speed or easing, working ...
1
vote
1answer
41 views
Convert array to object in JavaScript
I'd like to convert an array into an object using one of the properties as key.
For instance:
var stations = [ { name: 'A Coruna', ds100: 'OECSC' }, ... ];
I'd like to get stationByDs100:
{ 'OECSC'...
-1
votes
0answers
7 views
How to work with project versions in Node.js
I want a place to mention what the version of my project is (e.g. 1.4.5). I've heard that it's common to locate it in package.json. I want a solution that's considered as a common practice, and ...
-6
votes
0answers
13 views
Live Chat not cloud service [on hold]
Can anyone help me to find an opensource, or paid service for Live Chat, and its works in my local servers, and my databases without needing to make an integration with their site. I need it as Not ...
-5
votes
2answers
25 views
Count Down - Java Script
It's a countdown code that I modified it,
I want the countdown don't show zero variants like real countdown systems,
and I want it in java syntax not with jquery libs!
but What is wrong with this ...
0
votes
3answers
24 views
How to do a redirect to different domain but same directory for all links site wide? Javascript?
We have an old domain on an old shopify site. We have a new domain on a new wordpress website.
Our goal is to re-direct all old links from the old site/domain to the new site domain.
For example if ...
0
votes
1answer
16 views
replace numbers inside textinput from arabic to english and accept negative numbers?
i write this code to convert arabic number to english number when the user start typing inside testinput its working fine but how i can enable it to accepts negative value it's prevent me to type (-...
-1
votes
0answers
25 views
How to call java function in .java from javascript?
I am currently using cordova/phonegap in eclipse. I want to call the saveToken (token) in my MyFirebaseInstanceIDService.java from the JavaScript in my html file. i created a class called ...
0
votes
0answers
16 views
how to access object property name in v-for
I'm new to vuejs.
I started to play with v2.
I have a simple array with object in my instance data property:
items: [{"theProprtyName": "thePropertyValue"}]
I do simple v-for:
<v-list>
&...
-10
votes
0answers
39 views
Merge Array Range
P.S: Programming Language DONT matter.
I have and array containing range of min/max ( they can collide. i.e min=max is possible)
https://repl.it/FYdk
$range =
[
[100,120],
[230,235],
[...
0
votes
0answers
16 views
How to prevent a movable character going off the screen
I currently have an object that I am able to move around using the arrow keys on the keyboard, however, the object moves off the screen. How can I get the object to remain on the screen?
$(document)....
1
vote
1answer
24 views
jQuery click trigger on element associated with javascript object
I've got a section on my page where there's a couple of blocks. When loading this page, I create an array blocks[] that stores a block object for each one, these contain some more information on the ...
0
votes
0answers
12 views
Large Number of Node Modules after create-react-app eject
I ran create-react-app eject because I wanted to use LESS on a project. I noticed after doing so the number of modules under node_modules in my project had significantly increased. I started another ...
0
votes
1answer
9 views
Usage of Forloop in Function callBack that is executed recursively
This is the code snippet I have. Please Help me to handle the for loop inside the callback function. Right now, the for loop get executed before the results in callback appears.
$scope....
0
votes
3answers
8 views
Build multiple react native bundles from one source
For example I have React Native application with some features. The most complete application contain
News
Products
User authorization
I want to have 2 builds. Like "free" and "pro" version.
Let's ...
0
votes
2answers
16 views
Why do checkboxes have setSelectionRange property and how to test for whether selection can be made?
I am pretty sure I used to test check boxes for the setSelectionRange property and they did not have one. But that seems to have changed in some browsers (tested Firefox and Chrome).
I used to do a ...
0
votes
0answers
4 views
Cordova Show InterstitialAd on Click
I'm using appfeel cordova admob plugin.
https://github.com/appfeel/admob-google-cordova
I want to show InterstitialAd on click function at my cordova apps. Normally with default options, ...
0
votes
0answers
21 views
Jquery after bootstrap modal is closed, scroll is disabled
I have two bootstrap modals and they are both open simultaneously, when one is closed the other one is unable to scroll, like there is no scrollbar although the height is bigger the screen height.
...
2
votes
1answer
15 views
AngularJs Pass data using Input component
I'm trying to learn AngularJs 2 using free video tutorials from scotch.io website. I followed the most parts without any problems. But I cannot work out passing data from one component to another.
...
0
votes
2answers
14 views
How to get data from Database/Model with JavaScript
I'm new to ASP .NET, MVC and AngularJS so I'm trying to figure this all out still.
I have a Model called Words.cs which contains:
namespace liveSearch.Models
{
public class Words
{
...
2
votes
4answers
27 views
Is date() function in node js giving server side date or client side date?
I am new to Node JS. If I write Date() in node.js will it give server side date or it acts like its original javascript behavior as javascript Date() gives client PC date. So in Node JS how will it ...
-3
votes
1answer
33 views
What is … operator in ES6? [duplicate]
Following is a code snippet from a react-redux boiler plate application.
const middleware = [thunk]
// ======================================================
// Store Enhancers
// =============...
0
votes
2answers
21 views
How to pass the button ids of an array of buttons to php file?
I want to create new buttons using a single button, and after creating those new buttons, I want to click on them and have their id number sent to the php file.
my code:
<script>
var count=1;
...
0
votes
0answers
15 views
Select2 ajax/custom querry
i have this code:
var locations = [
<?php foreach($locations as $loc) {echo '{ id: ' . $loc['id'] . ', text: "' . $loc['name'] . '" },';} ?>
];
$("#location-id").select2({
...
0
votes
1answer
8 views
Angular ngRoute suddenly converts URL into encoded characters #!/#%2F
Everything in my app was working fine until I tried to add ngAnimate, ngMaterial and ng-image-gallery.
I don't know whether adding these modules is the source of the problem, but I didn't change ...
0
votes
1answer
8 views
Catch the error with the callback function
I wrote my middleware in order to use an external code for the management of the users account. When I'm creatin a new account I use the related function of the Manager as per following code:
.post(...
0
votes
0answers
10 views
How to show the quiz answer on click using php and javascript?
Hi I am writing simple quiz application using php and mysql.I successfully added question,option and Correct answer to the webpage.I want to compare the user selected option with correct answer using ...
3
votes
3answers
31 views
Get the Value of Radiobutton Using JS
Problem: I have not been able to get the value of a radiobutton or value in a textbox.
From trial and error, I found that the following gives me access to the information in div gender1
I could not ...
0
votes
1answer
21 views
Building an array in for loop with asynchronous calls
I'm new to JavaScript and I'm trying to do something as below. I want to iterate over a list, and make database calls that are dependant upon the item in the list. Obviously, because the calls are ...
0
votes
0answers
4 views
Behaviour of text search
I implemented MongoDB Text Search in my NODEJS with MONGOOSE application and if I search for something then the results sometimes don't make sense for me.
Can somebody shed some light on the ...
0
votes
0answers
7 views
Directive/Component name 'ng ' is invalid. The name should not contain leading or trailing whitespaces
Trying to run my app in production
And get a strange error
CODE/ERROR MESSAGE
angular.js:68Uncaught Error: [$injector:modulerr] Failed to instantiate module ng due to:
Error: [$compile:baddir] ...
0
votes
0answers
8 views
Observe Immutable.js object with callback
Is there a way to observe an Immutable.js object similar to this?
var myMap = Immutable.Map({ name: 'John' });
myMap.onChange(function(newValue, oldValue) {
console.log(newValue);
});
myMap.set('...
2
votes
1answer
29 views
Modal display <br> instant of next line
There is a while loop to display all data from database and there is a button on each div. When a user click the button then that particular information display in a modal. Actually its working fine ...