Tagged Questions
JavaScript (not to be confused with Java) is a dynamically-typed language commonly 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
0answers
14 views
Javascript syntax error token
this is my code
var text = "";
var text += "function "+ funcName + "(){";
var text += "\n";
and this is the error:
**Uncaught SyntaxError: Unexpected token += **
How can I solve it?
0
votes
0answers
9 views
How does jquery decide whether it should return it's current list of elements, or 'this'?
when using something like var divs = $('div'), jQuery returns a list of elements, yet it's still possible to run methods from that variable. I understand method chaining, but here something else seems ...
0
votes
0answers
9 views
JS not binding events on refresh
I have a JS file, which does a couple of $(window).on('scroll', function() {...}); This is wrapped in a $(function() {..});, the code works if I hard refresh, so the files are of a code 200, but then ...
1
vote
0answers
8 views
Combine GridLayout and ScrollView in Famo.us JS
I'm trying to insert a grid layout into a scroll view in famo.us (using famo.us with angular) and the most obvious way is working
<fa-view>
<fa-scroll-view fa-pipe-from="eventHandler" ...
0
votes
3answers
18 views
Replacing Value of Input based off of the sun of two inputs
Im trying to add up the sum of two inputs that already have a value in it. I wanted the sum to change value if any of the other two inputs change in value. I have this the following, but its not ...
-1
votes
1answer
22 views
HTMLElement.append does not append - JavaScript
What are some possible reasons that this code could not append the tag to the #abcde div?
var div = $('#abcde');
console.log(div);
...
0
votes
0answers
7 views
callback - redis (key, value)
I have file, lets call it "file1" and insert a key value and fetch it as well; so here I have my implementation for file1:
var rdb;
module.exports = function(_app) {
rdb = ...
0
votes
1answer
11 views
Adding Color to a Draggable
How would you add a draggable that has a specific color, e.g. blue?
I've been using
<script type="text/javascript">
$( function() {
$( ".box" ).draggable({containment: ...
0
votes
1answer
6 views
Meteor: Error: ENOENT when trying to access an image using node-gd
I can't understand why I'm getting this "Error: ENOENT" error. Here is my Meteor server method:
createImage: function(coords) {
console.log('createImage')
console.log(coords.area)
...
0
votes
0answers
9 views
Passing a javascript argument into D3
I am currently making a scatterplot matrix in D3. My data point structure looks like this:
function plot(p) {
var cell = d3.select(this);
x.domain(domainByTrait[p.x]);
...
0
votes
1answer
22 views
jQuery hover shows and hide my content
I'm trying to show some content when I hover over an image... and hide it again after that. My problem is that, when I hover over the image the content is shown (but not instantly), and the content ...
0
votes
1answer
23 views
Javascript function not reaching other function?
So the code I have is:
PrintPage.aspx
<asp:Button ID="ViewAuctionsButton" OnClientClick="checkValidated();" Text="Visa" CssClass="" runat="server" />
<script type="text/javascript">
...
0
votes
0answers
3 views
unit test angular $event with jasmin
what would be the best way to test this directive function?
$scope.addToToList = function(event){
var offset = $(event.target).offset();
addToListService.showPopUp(offset.left, ...
-1
votes
0answers
12 views
duplicating a button and link to new database table
Found code for a like button and need help. The resource_id and resource_type are in the database linking to the table 'likes'.
I am trying to make a new button labeled "awesome" that uses the same ...
0
votes
0answers
5 views
Pareto Chart/Graph using Javascript/Html/JSON
Im trying to find any plugins, examples or related resources on how to built a Pareto Chart for an html page. I'd like to be able to built it out of html, style it w/ CSS and populate data via json. ...
1
vote
0answers
27 views
White space at the bottom of div caused by Hide/Show content
I need help with trying to stretch a scrolling div to 100% the height of it's parent container, but the Hide/Show content creates a whitespace at the bottom of the div.
Here's the jsfiddle: ...
0
votes
1answer
27 views
Is this method of conditional javascript loading of any value?
I am building a multi-page front end for a web application. There is minimal javascript for the UI, but I know there will a great deal of javascript to handle the back-end, so I am doing my best to ...
0
votes
1answer
5 views
iScroll page currently scrolling to detection
I use the following iScroll 5 code (generally, not so important: just a common scrolling page-by-page):
var myScroll = new IScroll('.scroller', {
mouseWheel: true,
...
0
votes
0answers
14 views
How to launch a new Internet Explorer process using javascript (iexplore.exe)?
Is it possible to launch new IE process each time when we open new window through Javascript?
0
votes
0answers
12 views
Submenu pop out from div wih overflow set to hidden
I need to create horizontal menu with sliding option and submenu. Because of sliding option I have to set overflow on hidden, but than I have problem with submenu. I would appreciate any help or idea ...
2
votes
1answer
20 views
Angular $watch property on all objects in array
I am trying to understand how best to achieve the following in angularjs.
1) I have an array of objects:
$scope.myArray = [{special:false, name:'alice'}, {special:false, name:'bob'}];
if ...
0
votes
0answers
22 views
why can't i call my own function from onclick?
this one
<a id="submitbutton" class="btn" ontouchstart="alert('test');">Submit</a>
works, but this one
<a id="submitbutton" class="btn" ...
0
votes
0answers
2 views
Using the sedac/GPW PopStat API with REST
I am having a hard time figuring out how to use the following API:
http://sedac.ciesin.columbia.edu/mapservices/arcgis/rest/services/sedac/GPW/GPServer
...
0
votes
1answer
16 views
Add image file to site directly from url
In a website we are building based on Django and jQuery we would like to let the user add an image directly from a webpage or url
We want to simplify the process of adding an image to an object in ...
0
votes
1answer
19 views
nav bar on scrolling page. active link
Currently my website has the scrolling function with a fixed nav bar (page scrolls down when you click the differernt links on the navigation. I added the function that the page you are on the has an ...
-2
votes
0answers
26 views
JavaScript-DOM does not work :( [on hold]
A simple question: What's wrong with this???
<script type="text/javascript">
function click () {
var element = document.getElementById("box");
element.style.color = "#FFFFFF";
};
...
0
votes
0answers
26 views
Scrollable Div appearing smaller in IE and Firefox
I have a scrollable div in td. It appears fine in Chrome however becomes really small in IE and Firefox but the height of the row stays the same. I have tried to change overflow:auto to ...
0
votes
0answers
26 views
Page is not rendered after ajax call in chrome and IE
Following call is failing in chrome and IE but works fine in firefox
var count = 0;
var timerId=setInterval(function(){
jQuery.ajax({
url :"test.htm",
...
0
votes
0answers
11 views
Where does Require.JS belong in a template engine?
I am using a framework on the server side to build re-usable views (aka templates). Should Require.JS be inserted in the main template that is extended by all pages or just the pages that use ...
0
votes
0answers
10 views
How to make brush from cursor in javascript?
I have some SVG with many circles. I want to allow user choose beetwen single clickin on circle (and change some attributes) and using brush to click multiple circles at one time. I want to allow him ...
0
votes
0answers
18 views
how to remove the option to go back to the previous page in Google Forms
I created a questionnaire on Google forms and I want to remove the option to go back to the previous page. I dont want the Participants will copy from previous responses.
I realized that this is ...
0
votes
1answer
11 views
Make Mocha wait before running next test
Got some mocha tests that require data from prior function calls, but then because it's using a webservice, and would like it to literally wait for a predetermined amount of time before running the ...
0
votes
2answers
10 views
How do I force a knockout update for a particular HTML element?
The way I understand it, I have an HTML element which is bound to a particular property in a koObservableArray. It's not bound to its own koObservable due to the setup of the structure.
<input ...
0
votes
1answer
12 views
$watch an attribute only after certain event
Im learning angular and i'm trying to build a form that:
1.on-blur checks if an attribute value is unique or not.
2.if the value is not unique then it starts watching the value and gives or deletes ...
0
votes
1answer
20 views
How to escape invalid character like … in routes?
There's a search bar in my webapp that can search people's name. I want to escape some invalid characters in the frontend to prevent undesired result, for example, searching ... will lead to routing ...
0
votes
0answers
4 views
Gridster Cell Swap
I'm using gridster library Gridster Javascript Library for my web project.
I'm building crossword website using gridster but I have problem on Apple iOS devices, when user enter letter in field ...
0
votes
0answers
21 views
Sens multi assoc arrays trough jquery post to php
I have a form with nested arrays like so:
name="createmainaddons[' + mainaddid + '][subaddons][' + special_row1 + '][subaddonsradio]"
the rows and counters are done by javascript.. WHen i post this ...
0
votes
1answer
8 views
angular passing index of currently selected item (in select list)
I am trying to pass through the index of the currently selected item so that I may use it's index to dig deeper into some nested array. Here's what I have so far.
my controller:
$scope.scope1Change ...
0
votes
1answer
11 views
$compile breaks ng-repeat
So I am trying to loop over a list of elements generated by an ng-repeat, tag them with a directive (in this case ng-show), and then re-compile using $compile. The problem I am running into is that ...
0
votes
1answer
12 views
Ajax request doesn't work with Spring controller
Can't understand why this code always prints in console "Error!".
Here is my Spring controller
@RequestMapping("/spinner")
public class SpinnerController {
@RequestMapping(method = ...
0
votes
3answers
28 views
Hiding a parent element using JS/JQuery based on the alt tag of a child element
My portfolio website has a Wordpress backend, and I use a Wordpress gallery to produce links to my various projects. It is getting somewhat bulky now, however, and I would like to give visitors the ...
1
vote
0answers
7 views
Masonry and Lazy load integration
I'm working on this website
The products on the center and right column are in a masonry container.
The problem I have is that If I apply the lazy load plugin to it, since it has different heights ...
0
votes
1answer
17 views
Converting Text input to an actual parameter for javascript funtion
I need to convert the messbox value so it can be passed into the loadPHPDoc function, but i cannot seem to successfully transfer the data. It successfully loads the php document when i place quotation ...
0
votes
1answer
24 views
AngularJS Providers and Models
I have an angularjs front-end that talks to a Web API backend. I am new to this framework and unsure of how to pull complex data from the web api into my application $scope. I will then be using ...
0
votes
0answers
16 views
js - converting array buffers to string
I'm getting some weird results when converting an array buffer to a string then displaying the output in a div.
I'm getting some GPS data from the USB port in a chrome packaged app. It converts the ...
0
votes
2answers
22 views
Insert a function in bootstrap's javascript
I'm doing a register form with bootstrap, everything is fine but i want to display an input when i click on a button. The html and css are working but i don't know where to put my javascript code. ...
0
votes
1answer
13 views
JavaScript error trapping is not reading 0 (zero)
The JavaScript below just checks if there are 4 digits in a field or not and then warns if there isn't.
But for some reason, if I enter four zeros (0000) it takes that as an empty field and throws ...
0
votes
0answers
15 views
PHP data from route in AngularJS
I am sending a variable to a PHP file as a parameter on a route with AngularJS. The PHP file then returns an array of objects in a Smarty variable that I would like to use in a normal ng-repeat in the ...
-1
votes
1answer
15 views
variables in QueryString
I'm new to QueryString. My issue is:
-I need to pass a cookie value through an URL that exists already to a third party application that can collect information from the URL.
-I am able to get the ...
0
votes
0answers
6 views
Uncaught TypeError: object is not function for dojo custom widget
I'm getting the subject error when I try to instantiate a class in dojo widget I'm creating:
I have the widget and the html template for the widget in a directory called /Templates. Here is the code:
...