Tagged Questions
JavaScript (not to be confused with Java) is a dynamic, weakly-typed language typically used for client-side scripting. Use this tag for questions regarding ECMAScript and its various dialects/implementations (excluding ActionScript). Unless a tag for a framework/library is also included, a pure ...
0
votes
1answer
3 views
Jasmine date mocking with moment.js
I'm using moment.js for date/time in my application, but it seem like it doesn't play well with Jasmine's mocking capabilities. I've put together a test suite below that shows my issue: ...
0
votes
0answers
2 views
If element is scrolled on data-attribute then
I have two headers (menu1 - default, menu2 - display:none).
In sections of website I added special attribute (data-ix="change-header").
I want to have the effect.. that if I will scroll site and if ...
0
votes
0answers
8 views
body of a for in statement error in JS
Im racking my brain on this, and ive read all of the previous questions that have been answered, but i feel that im just missing something. how would you all go about resolving this error?
function ...
0
votes
0answers
8 views
Parsing JSON to exclude duplicates Node.JS
First off, I'm new to NodeJS and JavaScript, so any help would be greatly appreciated.
My goal is to be able to parse a csv file so that I can see how many users log in each month. In order for me to ...
-2
votes
0answers
7 views
How to removing leading zeros from textbox on the fly or focusout using jquery/javascript
How to removing leading zeros from textbox on the fly or focusout using jquery/javascript
Tried many ways but no luck.
0
votes
0answers
2 views
Server-side paging with google visualization API - how do I get paging controls to show?
If I initialize a table like this:
google.load("visualization", "1.1", {packages:["table"]});
google.setOnLoadCallback(drawTable);
table.draw(data, {showRowNumber: true, width: '100%', ...
0
votes
0answers
13 views
Running a function after another function with loops & promises in jQuery/JavaScript
I'm working on a college/personal project which takes RSS urls and sends them through a series of APIs. Code follows:
var tempStory = [];
function getFeed () {
...
0
votes
1answer
10 views
Make height of div container smaller when nested divs slide out
I'm trying to make the height div.container smaller whenever the divs inside of the div.container slide out on click, but the height of the div continues to stay the same height.
I also want the div ...
0
votes
0answers
2 views
Include default hidden variables in CodeMirror
I want to have access to values outside of the CodeMirror editor, but without having to explicitly define them inside to editor box. I guess kind of like globally defined namespaced variables that ...
1
vote
1answer
11 views
jquery not working in rails
I've read many pages about using jquery in rails and still can't seem to get it to work.
I have the 'jquery-rails' gem, and I installed.
I have the require statements in the application.js file.
...
0
votes
0answers
5 views
My Datepicker dont open when click yii2 framework
When i click a datepicker don't open
<?= DatePicker::widget([
'name' => 'dp_3',
'type' => DatePicker::TYPE_COMPONENT_APPEND,
'value' => '23-Feb-1982',
'pluginOptions' ...
0
votes
0answers
11 views
Receive data json/jquery
Good evening!
Trying to learn how to receive data with json/JQuery using following function. I've managed to store the php variable in a json variable (var ar), and it seems to contain what I want ...
0
votes
0answers
11 views
FullPage JS scrolling issue
The website is working as intended so apart from an annoying issue where it automatically scrolls everything back to the start of the second section.
Is there any way I can keep the scroll from the ...
0
votes
0answers
12 views
Post a comment from HTML to C# model in a list using MVC
I have tried several fixes, but not seem to fit. I am creating a post and comment partial classes that go onto a main page. I would like to allow an end user to add comments. I am using MVC 5 and ...
0
votes
0answers
5 views
Leaflet clicking on features
So, I'm trying to map bus routes using leaflet w/geojson for the coordinates. I'm having a difficult time with one aspect where, on a click, the bus line is boldened, and, ideally, the last clicked on ...
0
votes
0answers
2 views
JQuery Lookup from within JQueryUI Modal from Datatables ajax Source
We have built an asset register using datatables which gathers its data from the ajax data source as below;
{
"data": [{
"assetid":"<strong>000004</strong>",
"assetname":"Dell R210 R2 ...
0
votes
0answers
6 views
How to handle max URL lengths in IE?
I'm handling a GET request that grabs a bunch of parameters and prompts a window.open to download a resource from a specific URL. The URL ends up become pretty large for certain requests (2100 + ...
0
votes
0answers
7 views
animated snow from AS3 to JS
I have a project that I rebuilt in flash using the canvas option. Everything is working out great! I just have on issue, the project in flash has a function that I used to create some dynamic snow. I ...
0
votes
1answer
13 views
Google maps geocoding does not return location
I'm trying to use Google Maps Geocoding API in javascript. I have the following code:
var geocoder = new google.maps.Geocoder();
function geocodeAddress() {
var address = ...
0
votes
0answers
12 views
Is it possible to check if an external page exists using Javascript? [duplicate]
I'm trying to check if an external url that I'm linking to is broken so I can alert the user.
Ajax is giving me errors because of the "same-origin policy".
This is what I have at the moment (Stole ...
0
votes
2answers
13 views
javascript count up from start date and time, multiple targets
Hi I am building a time tracking app and I am saving a bunch of start dates and times in a database and if there is not end time I am using the code in this stackoverflow answser only difference if I ...
0
votes
0answers
2 views
How to save positive assertion in node-openid to avoid re-authentication
I want to know how positive assertion from openid provider will be saved so that user will not be redirected to the openid provider again if he refresh.
here is my code which verify assertion.
var ...
0
votes
0answers
11 views
How to submit 2 Forms w/ 1 Submit using Javascript?Both forms using method=post
Heading
Hello,
I tried to do every thing I could (being a non-developer) I am stuck in this last part.
Case:
1. I have 2 forms( namely: quiz & subscribe ) to be submitted with one button.
2. ...
0
votes
1answer
14 views
Sharing and observing data across controllers
We're using a tree-style navigation element which needs to allow other directives/controllers to know:
What the current selection is, and
When the row selection changes
I'm trying to determine the ...
1
vote
0answers
10 views
How to load RxJS in a minimal Angular 2 app using systemjs?
I'm unable to get a minimal Angular 2 application using RxJS off the ground. I'm using Typescript (tsc 1.6.2) and systemjs for module loading. How do I get systemjs to load the Rx module correctly? ...
0
votes
0answers
5 views
REST-like optional paramters in AngularJS UI-Router
I have an url: /test2/foo/{int}/bar/{int} and a state that it leads to.
I'm trying to figure out the best approach for making the parts after /test2/ optional. Obviously, it's easy to do with with ...
0
votes
0answers
4 views
Can't link Twitter with Satellizer.js
The Facebook, Google and Yahoo login for satellizer.js was pretty straight forward. All I had to do was create apps with their respective API's, configure them with my homepage's URL. Then I added the ...
0
votes
0answers
3 views
Trouble deleting from model using Backbone.js
Im new to backbone and trying to figure out how to make a button that deletes all data of a table in the db. I've looked around all day trying to find solutions to achieve this and have come up empty. ...
0
votes
0answers
8 views
error with using toType when where is in use
I am getting error when the following code runs:
let em = new breeze.EntityManager('http://localhost/api');
let query = breeze.EntityQuery.from('Customer').where('State', '==', ...
1
vote
5answers
33 views
Need help correcting a function in text game
I'm trying to teach myself how to code a simple text game. I found a YouTube tutorial and am working my way through Der Kerker. A problem I have is that his final code doesn't match what he did in ...
0
votes
1answer
12 views
JS: Convert Today's Date to ISOString() with Fixed Time
I'm trying to convert today's date to an ISO standard string but with the fixed time of T00:00:00.000Z.
I can get as far as returning a ISO string of today's date and time:
var isoDate = new ...
0
votes
1answer
13 views
js write nested json object
I've that data:
var data = {
resultDescription: "SUCCESS",
data: [ ["JAN","1048729"], ...
-1
votes
1answer
23 views
Error appendTo() using div
The question is that I want to append a <script> inside a div. If I use the following code it works fine:
$("<script />", {
"src":"http://en.parkopedia.co.uk/js/embeds/mapView.js",
...
0
votes
0answers
9 views
How to examine AngularJS text input field for reason of non-validity
I've got an AngularJS v1.2 form that is doing automatic phone formatting. The library I'm using is validating upon submit, but when returning to edit, the same field and same value is showing up with ...
0
votes
0answers
10 views
CSS not updating after Jquery script - Isotope asymmetrical filterable grid
I am trying to create an asymmetrical grid filterable grid with Isotope, where asymmetrical means each column has a different margin-top value:
.active:nth-child(3n+1) .tile_inner {margin-top: ...
0
votes
0answers
3 views
knockout-sortable 'dragged' callback not working
I am trying to adapt the example fiddle from the knockout-sortable in order to use the 'dragged' callback instead of the default 'clone' function.
http://jsfiddle.net/mp2k170t/1/
I've added a ...
0
votes
1answer
13 views
jQuery script doesnt work on higher versions
i have a toggle-script for the height of a list by clicking on a button.
Problem is, it works for jQuery under 1.8.3. But my website using 2.1.4 at the moment, so what is wrong on the script?
...
0
votes
0answers
18 views
Return value from a self calling function [duplicate]
I am not an expert in javascript or node so this is probably something simple. I have tried to search but I cannot find an answer.
I have
request({url:url}, function (error, response, body) {
if ...
1
vote
1answer
7 views
Convert year, month and day to single date in jQuery
The ruby method
DateTime.new(@year, @month, @day)
uses three integers @year @month and @day to create a single datetime.
Is there a jQuery method that accomplishes this?
0
votes
2answers
18 views
Throttled, cancelable async functions
I'm sure there must be something out there that'll do this for me.
I have a web user interface that shows a list of items. If you click on an item, two things will happen; the UI will be updated ...
0
votes
0answers
10 views
Express - function prototype toString() in error handling?
I had a longstanding issue with Express spitting out HTML strings instead of JSON, when we clearly were trying to force JSON to always come out of the server no matter what -
it turns out it was a ...
-3
votes
0answers
23 views
Add numbers in row javascript
I am relatively new to javascript. This is my third month in this class I am taking and right now we are making a golf score card. I have a table that holds the golf score card data.
Holes 1 2 ...
0
votes
1answer
25 views
JavaScript counter - rounding of the result
I want to create a simple counter in Javascript and I have a snippet for it already. The issue is, I would also like for the counter's value to increase by a value of decimals. If I simply use, for ...
0
votes
1answer
23 views
Game Coding for Javascript?
I'm new to Javascript and for a class I'm taking we're supposed to finish up the code to make a game work. The game is of a truck and it's supposed to catch kiwis that are falling from the sky. The ...
0
votes
0answers
10 views
Dynamically adding polymer google-map-markers via flask templating
I am working on a flask application with polymer google-map and google-map-marker elements. At various times (map movement/zoom events, external filtering of markers) the app makes server calls to ...
-1
votes
0answers
12 views
JavaScript implementations of Turbo Codes? [on hold]
Are there any JavaScript implementations of Turbo Codes?
https://en.wikipedia.org/wiki/Turbo_code
0
votes
5answers
16 views
Can a form submit to different pages based on field value?
I would like to create a text field box and a submit button where:
index.html: If user input in text box field "123" click submit will go or jump to john.html page.
AND
If user input "456" click ...
-1
votes
1answer
34 views
Can't get form to work in inner HTML
my problem is that I have a form that I want to make appear when I click a certain Edit button on the top. A normal form without that action="return.php" will work, but this one won't. Any ideas or ...
0
votes
1answer
15 views
Jquery focus on specific input elements using switch statement
What I'm trying to do
When user press enter, I wish to focus on those input elements which data-index attribute value between 0-2 also there type is text and check their attribute values using switch ...
-4
votes
1answer
26 views
Creating a JSON object from a List of Lists
var data = [
[
"default_PROJECT",
"Allow",
"Connect",
"Allow",
"AddComment",
"Allow",
"Write",
"Allow",
"ViewComments",
...