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
how to get the hrml tags one by one using HTML?
I wish to get the entire html of a selected element not just it's contents. .html() uses javascripts innerHTML() method according to the documentation. HTML:
<div id="div1">
<p>Some ...
0
votes
0answers
2 views
how to get filepath outside of base64ToFile.convert function
var base64ToFile = require('base64-to-file');
function len(params) {
var ss;
base64ToFile.convert(params.imgvalue,"demo/",['jpg','jpeg','png'], function (filePath) {
console.log('**file:**...
0
votes
0answers
10 views
Use function as an “on” event?
I currently have this function:
function highlightBoxes() {
var windowStart = $(window).scrollTop();
var windowEnd = windowStart + $(window).height();
$('.box').each(function() {
var box = ...
0
votes
0answers
17 views
Using JQuery to replace text in HTML but ignoring certain HTML id's
So I'm currently using Handlebars to grab data from a JSON file to show its data on the screen. Right now it's looking similar to this:
<div class="content" id = "topic">
{{#each topics}}
...
0
votes
0answers
10 views
Passing JSON From Angular 2 Form To Node Server Side
I have all the pieces to add my form data to the postgres database but I am having trouble understanding the actual hand off of the data from the form to the route.
I am creating an object with the ...
0
votes
1answer
12 views
Styling - vertical-align image and text inside a tag inside td tag
I am recently coding a navigation dropdown menu.
I add style="vertical-align: middle;" everywhere.
The image and text still won't align middle vertically.
I need the table still there so I can add ...
0
votes
0answers
11 views
What the purpose of “the following steps are performed in place of step 29”
I'm reading EcmaScript spec, at the section 9.2.12, the step 29 is:
NOTE: Annex B.3.3 adds additional steps at this point
Then I go to reading the annex B.3.3, I find this:
following steps are ...
0
votes
0answers
11 views
Executing an array of promises in order [duplicate]
Without the use of any extra libraries other than vanilla es6 I am trying to implement a function that executes an array of promises in order... I have tried something like
const promiseList = [foo, ...
-1
votes
0answers
7 views
Make custom json for javascript vtree plugin
I want to make a json for JavaScript vtree plugin. My script is.(ignore this extra text, as my post is mostly code so i added this extra line)
foreach ( $campus_info as $row ) {
$var [] = ...
0
votes
0answers
9 views
Final adjustment needed for collapsible menu (jquery)
function collapseAll() {
$(".cmenu > li > a ").each(function() {
$(this).addClass("collapsed");
$(this).find("+ ul").each(function() {
...
0
votes
0answers
9 views
accessing file system in javascript or jquery or angularjs
I have a web application whose purpose is to upload some excel files and images related to that excel file. Now for example if directory structure on client side is as follows
..
/education.xls
/...
0
votes
0answers
8 views
Phonegap Build app fails on an Android phone
window.requestFileSystem = window.webkitRequestFileSystem || window.requestFileSystem;
window.requestFileSystem(window.TEMPORARY, 1*1024*1024, createFileForDropBox, errorHandler);
Hi the above ...
1
vote
2answers
41 views
How to convert string to a function
So this has been bugging me. For example, takes a string input and draws its function. So I am wondering how it takes a basic string and returns a function that can be run. Not desmos.com specifically ...
2
votes
2answers
19 views
Understanding and Reading jQuery
Let's say I have an html file that loads up file.js and it looks something like this
(($) => { *some code* })(jQuery);
I really don't understand what (($) => indicates. And what the (jQuery) at ...
1
vote
0answers
9 views
How to pass a store to google maps places
I am new to google maps api's. I am building a website with google map places. I have search box. when ever a user types a area i want to display all hotels near by it with complete address in sidebar....
1
vote
0answers
22 views
How do you make all input into an event lowercase?
I have made a discord bot using the api https://discord.js.org and everything was going smooth until I started to add things to it that weren't commands. Normally, I have the code at the beginning of ...
1
vote
1answer
19 views
How can I change the font, colour, size etc. of a javascript calculation?
I've looked at a lot of questions on the site, but they don't seem to be for similar issues to mine.
I have a countdown timer written in Javascript that produces an array of weeks, days, hours etc. ...
1
vote
0answers
24 views
How avoid div hide on refresh of page
i have some tabs design which contains three tabs in panel header and a link in left side bar.
How i need to do this
when i click link in left side bar that is the time all three tabs should be ...
0
votes
1answer
13 views
Django : combine variable and HTML id in template
I'm looking for a way to "concatene" a django object list (get via the get_queryset in the views.py) with a Javascript variable. then concatene them to a field of a model object.
My model is a blog ...
0
votes
0answers
13 views
Validation for the phone number using angularjs
I have a form which gets the phone number from the user.And it stores in the pattern (xxx)xxx-xxxx. For pattern generation I'm using angular mask. The problem I face here is in the validation. If the ...
1
vote
1answer
31 views
How to use the API key in Javascript?
I've been trying to figure out how to use this API, but I'm not sure what it means by needing to "populate the TRN-Api-Key header with your personal API key.". Where would I do this to get results ...
1
vote
1answer
44 views
I need to refresh my page to update the text-area, even though I set the text the same way as before
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<title>ZET</title>
<?php
$text = ...
0
votes
1answer
33 views
How to Pass Value of my Query to input fields using AJAX
im Very new on using AJAX. im using Codeigniter
my question is how can i get the value of my query and put it on the input fields. i have created some but all i can do is to alert them.
Model
public ...
0
votes
2answers
23 views
Learning TDD for first time…Jest or Enzyme?
As a self-taught programmer, I am about to start building a full-stack app, particularly this one from FreeCodeCamp
At this point, I am fairly knowledgeable with JS and React/Redux. That being said, ...
0
votes
3answers
20 views
javascript - redux thunk doesn't wait for any promise
I have an array like so
array =[ {message:'http://about.com'}, {message:'http://facebook.com'}]
I want to loop that array, at each item I will make request to server to fetch opengraph data then ...
0
votes
0answers
6 views
How to manage the resource path for node / react / redux project?
I got an html page, which have this folder structure:
/
/pages/ (All the .html)
/css/ (All the css)
/js/ (All the js)
I would like to create a pages/users/create.html and pages/main.html, they ...
0
votes
0answers
16 views
jQuery table column & row iteration dynamic list builder
I am trying to build a function that will alleviate some manual aspect to a project. The client has provided me with a list in Excel which I have converted to a table (thanks to Notepad++ and some ...
0
votes
0answers
10 views
Dynamic requiring React Native images
I'm working on including some flags to represent countries in my react native project. I discovered that you can't dynamically require images like the example below in react native.
require(`../...
0
votes
0answers
40 views
Can't fix Uncaught SyntaxError: Unexpected token <
<html lang="en" class="demo-2 no-js" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator" content=
"HTML Tidy for Linux (vers 25 March 2009), see www.w3.org" />
&...
0
votes
2answers
25 views
Get name of JavaScript Multi-dimensional array, not children
I have a JavaScript multi-dimensional array that had multiple values with a ton of sub-values. Here's what I mean:
var items = {
"Area": [
"Feet",
"Meters"
],
"Frequency": ...
0
votes
0answers
10 views
Smooth scroll from another tabbed page to another not displayed properly
I have a tabbed menu, and one of the page in tabbed menu has a link that need to go to the another tabbed page. This feature is working but when i tried to resize the browser or view in a mobile ...
-1
votes
0answers
5 views
ResponsiveSlides.js image doesn't left align completely
The image is not aligned completely left, but is indented about 18 px so the Prev arrow hangs out in space to the left of the image. Works fine centered on its own page, but not when contained within ...
1
vote
2answers
40 views
Array with Objects
I started learning AngularJS but had a little problem....
What is wrong here ? I try to declare songlist as an array with Song Objects but get an error to use "="
import { Song } from './song.model';
...
2
votes
0answers
11 views
Materialize dropdown not taking options in Meteor template
So, I'm working on a website with Meteor and Materialize-css, and attempting to implement a dropdown menu in the navbar, which activates on hover instead of on click.
I have my files this way:
...
0
votes
1answer
17 views
Finding the object's name using the constructor's argument's values
So using the following part of my code, I've been trying to find the object's name ("object's name" refers to foo, bar, baz, and jar below. Sorry if that's the improper term, couldn't find any ...
0
votes
1answer
42 views
modal not opening when user clicks on modal trigger
I have a pretty basic modal function on my website which displays a like, repost & comment modal, above the track, in which trigger has been clicked.
However, I have had to set it up in an odd ...
-1
votes
0answers
16 views
Retrieve comments from Huffington Post Article
I am aiming to retrieve comments from a HuffingtonPost article, and I am looking if there is an existing way of doing it or if there is a specific API that would help me implementing it.
-3
votes
0answers
40 views
Why does this loop break at one?
I have this loop that goes through the entire week to check when the user next has a class. It starts from the current day + 1 and needs to restart the loop counter to 0 if the loop didn't check ...
4
votes
0answers
30 views
Loading jQuery functions in Angular 2
What's the proper way for loading jQuery functions in Angular 2?
I've added my jQuery to ngAfterViewInit. It works fine for one route, but if I navigate to another one (e.g. from id: 1 to id: 2), it ...
0
votes
1answer
27 views
Error running script on existing element
I'm having issues running a script and getting and error on the addEventListener property. I understand that this occurs when I reference an element that doesn't exist in the DOM, but I'm running the ...
0
votes
0answers
9 views
Always display labels in autocomplete field
Im using JQuery UI autocomplete, my datasource is an array with labels and values, here is an example
diseases.json:
{ "diseases": [{
"value": "1",
"label": "cancer"
}, {
"...
0
votes
1answer
17 views
Android variable to JavaScript
I am building an Android WebView which loads an url on a server of mine. However, now I want to use an identifier from the Android as parameter of a function on the JS code and I simply can't do it.
...
-5
votes
0answers
9 views
How to disallow others users from embed code of my video? How can I remove IFRAME from my videos?
Because I don't want that other users copy embed code of my videos and put it on their websites!
Please someone tell me is there a solution for that?
Blogger!
0
votes
0answers
15 views
What is the difference between sending JSON.stringify objects and plain objects in javascript sockets?
I am building a javascript socket application which uses socket.io and I am new to network programming. I don't know what is the best way to pass data in the network. I understand that passing binary ...
0
votes
2answers
20 views
Add a border style on click along with adding item to cart
I am trying to add a border to a div that houses my product. I want it to work together with the ng-click I already have that adds the product to the cart. So, when a user clicks the 'select' button a ...
0
votes
0answers
4 views
yii2 creating passcode before accessing webpage
I needed a modal pop up to ask for a passcode. I did the following but it always redirect me to login page. And it seems like the session wasn't created at all.
main.php (layout)
<div class="...
0
votes
1answer
14 views
How to use a default value for undefined object property in VueJS interpolation?
How to use a default value for undefined object property in VueJS interpolation? My data is a computed variable and is undefined at first before selecting a selectedDataId in a selectbox so vue sends ...
-5
votes
0answers
22 views
Display size of an image using jquery
I am new to Jquery and I am working on the following project:
$(document).ready(function() {
$("#add-article").find("form").submit( function (event) {
event.preventDefault();
...
0
votes
3answers
15 views
Javascript console.log strings printing each character of an array on single lines [duplicate]
When I try to console.log strings in an array it prints each text character and the comma separators on a separate line:
var name = ["add","bas","cun","deh"];
var size = [2,5,7,9];
var price = [250,...
-3
votes
0answers
9 views
tab bar Icons wont display in react native router flux
im trying to display icons in react native router flux tab bar using 'import Icon from 'react-native-vector-icons/Ionicons';' but i think theres something that my eye cant catch. I believe i did it ...