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
3 views
How to split a multiline tsv data by rows
I am trying to figure out how to split a tsv data into an array where each item in the array is the row data.
The below is a sample data that I am dealing with
item 1 "address 1
street 1
city 1" ...
0
votes
0answers
3 views
Calling function with call in jsx
I'm trying to call a function from outside a class, and I want this function to have access to the same this variable (which means to props, refs, etc). I've been trying:
const something = (() => {...
0
votes
0answers
2 views
why my angular form is not dirty when I have changed inputs value in my $provide.decorator?
I want extend the default inputDirective in angular.so I wrote these code:
module.config(function($provide){
$provide.decorator('inputDirective',function($delegate){
var directive = $...
0
votes
0answers
2 views
How do I listen to a CKEditor widget's DOM content changed event?
I need to listen to when a CKEditor widget's content is altered using the CKEditor dialog. But there doesn't seem to be an event available for the same. This event is the closest thing available but ...
0
votes
0answers
9 views
Escape issue in html
I trying to escape the code below:
<div class="col-xs-12"><img class="blog-img img-responsive" src="{%CurrentDocument.GetValue("StoryImageURL")#%}" /></div>
Like below :
<div ...
0
votes
0answers
3 views
Phonegap image picker from gallery not working properly
I want to use a photo from gallery and then crop it. I am using this plugin. It has absolutely no documentation so I need a bit help. On button click, I want to open the gallery and select an image ...
0
votes
0answers
4 views
Did not detect a `bs-config.json` or `bs-config.js` override file. Using lite-server defaults
I am trying to run example Angular2 project. When I try to run it I got following message in the console:
...
[0] tsc -w exited with code 0
[1] Did not detect a `bs-config.json` or `bs-config.js` ...
0
votes
0answers
9 views
Can't send ajax headers from js script
I have build an API. It listens in port 8000 and my app is listening on port 3000.
var settings = {
"async": true,
"crossDomain": true,
"url": "http://localhost:8000/communities",
"method": "...
0
votes
0answers
5 views
save upload file with date jquery
i wonder if i can upload file with date that
i uploaded and save it in folder
how can i do it ??
html code :
<div class="panel panel-default" >
<div class="panel-body">
...
-5
votes
0answers
14 views
Javascript function - not sure which one - beginner
There is a problem I have to fix.
I wanted to make ecatalog. I created a pdf file and using pub html5, I uploaded it there.pub html5
How do I make the photo zooming automatically, while I move the ...
0
votes
0answers
27 views
AngularJS array separate by comma
I have the following JSON which will be set to $scope.episodes;
"the_numbers": [{
"episodeID": 16503,
"episodeNumber": 183
},
{
"episodeID": 16504,
"episodeNumber": 184
}]
From this ...
0
votes
1answer
29 views
DOM img node with src without loading image
I am using jQuery on DOM elements that are not added to the DOM tree of the actual page, nor will be, to render some HTML and get it as a string.
Minimal example is simply evaluating:
$('<div>&...
-1
votes
0answers
8 views
javascript error in console on custom page in magento?
I am using magento 1.9.2.4 for my website.
I got this error only login and register page in website in firefox
and some time in chrome
TypeError: registry is undefined
prototype.js (line 5557, col 9)
...
0
votes
0answers
5 views
How to get text from a textarea we entered using selenium
How can I get the text that I entered in a text-area using selenium where the text entered in the developer options in chrome and Mozilla where in IE its visible in the developer section. Using ...
0
votes
1answer
6 views
Angular Chart JS error angular-master.js:114 Error: [$injector:unpr]
I am working on Chart.js with Angular.JS my Angular app is looking like below
angular.module('inspinia').controller('dashboardController', ['$rootScope', '$scope', '$http','chart.js', function($...
1
vote
1answer
28 views
Why setinterval brings back an integer (newbie)
function myTimer() {
return new Date().toLocaleTimeString();
}
setInterval(function(){ myTimer() }, 1000);
why myTimer when called alone returns string as expected, but when called through ...
0
votes
1answer
8 views
Assigning a subscribed value to a variable : Angular2
I have a component that's displaying a value in {{getData}} if I fire the onDo() with a button click. onDo() is initiating a GET request to a server.
The server is giving back the response, and I am ...
0
votes
3answers
46 views
.click() jQuery function works for one ID but not variable
I have this code in my js file and basically what I want to test out is, if the user clicks on a certain button (which has ID of admin).
I want it to bring up a closeButton which is png image and ...
0
votes
1answer
22 views
Detecting and validating client date change in AngularJS
In my Angularjs application I have the limitation that if user changes his system date manually, application starts using that date for all UI operations.
I want to detect if user has changed his ...
0
votes
0answers
4 views
PaperJs: how to handle event Mouse enter in bounds of Item
I want to check event when mouse enter bounds of item.
My code:
itemPath.onMouseEnter = function(){
#code here
#but it don't work
}
Anyone can help me?
0
votes
0answers
19 views
Display value in xml with html by TagName and ClassName
I am trying to create a table in a HTML page with data from a XML document. The XML document contain of the root <printer>, child node <t> and it's child node <amount>. The value of ...
-3
votes
0answers
20 views
how to concatenate variable in the middle of a regex [duplicate]
I have regex working well like this:
var val = "amy,200;jack,100;joe,100;";
var regex = /jack,\d{3};/;
console.log(val.match(regex));
Now I want to put "jack" in a variable and make the code like ...
0
votes
0answers
5 views
how to get lat long from google map when our own geojson layer is there?
google.maps.event.addListener(map, 'click', function( event ){
alert( "Latitude: "+event.latLng.lat()+" "+", longitude: "+event.latLng.lng() );
});
this code gives us lat long when we click on ...
0
votes
1answer
11 views
can we assign value of an element to ngmodel using pure javascript
this is my sample javascript and angular code
var myApp = angular.module('myApp',[]);
function MyCtrl($scope) {
$scope.set="somevalue";
}
//javascript code
function addValueUsingJavascript() {
var ...
-9
votes
0answers
27 views
Round up a number in a Class with JavaScript [on hold]
I want to round up a number which is in a HTML Class:
<i class="d_inline_m">
<b>
-9,34%
</b>
</i>
How can i solve this Problem with JavaScript?
0
votes
0answers
12 views
Import Javascript Plugins into AngularJS component
I'm working on an AngularJS2 project, and I would like to use 3 Javasript plugins in one of my components (jQuery, FreeWall & MetroJS)
In my component I would like to have a <script> tag as ...
0
votes
0answers
14 views
difference between jquery date picker and bootstrap date picker
I am searching many blogs but i didn't clarity, which version of jquery and bootstrap to use. In my code, i am facing error like datepicker is not unction. I am not clear what is missing here actually....
0
votes
1answer
20 views
How to hide sidenav when click anywhere on the body except sidenav? [duplicate]
<!DOCTYPE html>
<html>
<style>
body {
font-family: "Lato", sans-serif;
}
.sidenav {
height: 100%;
width: 0;
position: fixed;
...
0
votes
0answers
20 views
javascript quiz construction sample
var answers = new Array(10);
answers[0] = "F.Scott Fitzgerals";
answers[1] = "Gertrude Stein";
answers[2] = "George Well";
answers[3] = "Alexander dumas";
answers[4] = "George Washington";
answers[5] =...
0
votes
1answer
21 views
jquery toggle slide animation to pure javascript animation
See here
https://jsfiddle.net/97Lahmoh/ OR http://www.w3schools.com/code/tryit.asp?filename=FB8TE2KSHGZ5
basically I want to use jquery ui toggle slide animation without any jquery and plugins.
this ...
-1
votes
0answers
14 views
Make Vending Machine Change Return more Accurate
Source: Code Wars
My vending machine doesn't need to return the exact change, it only needs to return the closest possible amount. It passes most test cases, but there are some exceptions. In code ...
-1
votes
1answer
19 views
Need help in Automated userid generation using jquery
I want to generate a login id automatically. Logic is to take the user's last name and append a number(like 1, then 2 , then 3). system will also check if this user id exist in database. I have cached ...
0
votes
0answers
16 views
Put string query in beetween the path in React-router
I am creating one app using reactJS. I am defining routing by react-router.
sample code is below:
<Router history={browserHistory()}>
<Route path="/" component={App}>
<...
0
votes
0answers
30 views
Segmentation fault in javascript with persistent function
Dynamic library is created using some C files. This dynamic library is used by a C++ function. One of the C-functions calls a C++ function. Which in turn will invoke a Javascript Function Callback. I ...
1
vote
2answers
39 views
Can be part of Text node highlighted?
I am creating Text node like var liContent = document.createTextNode(someHtmlString);.
And then add this variable into list like $("<li/>").html(liContent).appendTo(targetUnorderList);
Question ...
0
votes
0answers
10 views
New version jquery mobile does not work
I have two different versions of jquery and jquery-mobile, and I am trying to build a cordova project with it.
jquery.mobile-1.4.5.min.css
jquery-3.1.1.min.js
jquery.mobile-1.4.5.min.js
And
jquery....
0
votes
1answer
23 views
Square brackets after arguments list in JavaScript/TypeScript
Can anyone explain the meaning behind the "[0]" after the arguments list here?
let value = this.recurseMinimax(board, !player)[0];
function:
recurseMinimax(board: boolean[][], player: boolean): ...
0
votes
3answers
21 views
Recover a dynamic id
I have a javascript code that retrieves an id from a SymfonyType collection:
$(document).ready(function() {
$('.well').change(function () {
var day_n = document.getElementById('...
-3
votes
2answers
23 views
Should the Bootstrap media queries be saved in a css file or a js file?
I am using media queries for screen sizing, and I need help embedding the file into my HTML document. So, help?
<link rel="stylesheet" href="style.css" /> //This?
<script src="style.js">&...
-4
votes
1answer
16 views
Get browser console output/newtork with developer tools closed [on hold]
We need better error reports from our users and for that we need the console output and the network output that is produced from the browser. As users don't have the developer tools open or don't even ...
0
votes
1answer
20 views
Calendar heatmap: how to define the range of % for each color instead of using quantiles
I am creating the calendar heatmap using D3.
This is my current code:
<!DOCTYPE html>
<meta charset="utf-8">
<html>
<head>
<style>
rect.bordered {
...
1
vote
1answer
26 views
Get nearest match through multiple line using JavaScript
I have following output from Protractor test and I'm trying to parse and find name of failed spec:
Specs: /var/lib/jenkins-slave/workspace//tests/js/e2e/ui_e2e/tests/test_one.js
Selenium URL: http://...
2
votes
0answers
26 views
Open URL in iframe when put in browser bar
So i have a page with an iframe inside of it and iv'e used
<script type="text/javascript">
if (frameElement == null) {
//change location or close
window.location = "http://...
0
votes
2answers
26 views
Allow onclick event on TR element but prevent the event in the checkbox
How can I allow onClick event on TR element but prevent the event in the checkbox?
The checkboxes are children of TDs of TRs in table.
What I did in this problem is adding onClick on all TDs but ...
0
votes
1answer
35 views
how to replace a script tag with iframe dynamically
I am trying to insert a script tag after the iFrame tag. Here I want to find a script tag with data dash attribute and replace that element with iframe after that append a script tag.
Here is my code ...
3
votes
0answers
15 views
What is the difference between server key and legacy server key in FCM(Firebase cloud message )
I little confused with the server key I have to use in the in the FCM. There are showing two server key now.Please check the screen shot of the page
In the picture above shows the server key and ...
-1
votes
0answers
19 views
geting error - ‘Access-Control-Allow-Origin’ missing" while retrieving data from api in angular js
i want to get data from api which has basic authentication.i need that data in plain text in angular js . here im getting error saying - "Cross-Origin Request Blocked: The Same Origin Policy ...
0
votes
1answer
17 views
Back button changing iframe content page in web app
Happy holidays all!
I have a web app page that contains templates that user can select from. There is an iframe to preview the template in a4/print mode at the bottom of the page.
The user can ...
0
votes
0answers
7 views
Texture issue while using THREE.TextureLoader over deprecated THREE.ImageUtils.loadTexture
I was using this function to add Texture on a Cylinder.
function createElementMaterial() {
THREE.ImageUtils.crossOrigin = '';
var t = THREE.ImageUtils.loadTexture( IMG_MACHINE );
t.wrapS =...
1
vote
2answers
50 views
How to set width of input type “file” through css
if you click just below demonstration word then also the input type file will click.
how to avoid that , so click event fire only on that area whatever size i have given .
<!DOCTYPE html&...