var chartData = response.data.chartData,
labelKeys = Object.keys(chart.chartLabels);
labelValues = Object.values(chart.chartLabels);
var data = [];
_.forEach(chart.chartObj.data.labels, function(item){
var labelIndex = labelValues.indexOf(item);
if(labelIndex != -1){
var arr = _.map(chartData, labelKeys[labelIndex]);
data.push(_.sum(arr));
}
});
I'm trying to follow the async question/guide on this page, specifically the answer that is "If you're not using jQuery in your code, this answer is for you" How do I return the response from an asynchronous call? but I can't seem to get the value to return to the var. function maxYvalue2 (when...
I want to take the elements of an array, multiply them by their index position, and add the results together. So if I had: array = [1, 2, 3] I would get 8. // (1 * 0)+(2 * 1)+(3 * 2) = 8 What is the best way to do this in vanilla JS, simply for learning purposes?
So, I have this tables that servers as a scheduler calendar of sorts, and I needed a way to highlight some cells in order to set an appointment on the selected cells I followed this post and worked perfectly... except for IE10. Well, it work as well on IE10, but I tried to show a popup/context m...
Hello I'm making and edit of an agar.io extension and I want to do this: If i click a button, it detects if the input has no text and then it does the function of one button, if the input has text, it does the function of another button. $("#connect-party-btn").on("click", function() { if ($...
I have a legacy project with a lot of dependencies on jquery 1.8, if I want to upgrade to 1.9 but maintain the older version while I download the new one from nugget, can be that possible? I just want to use the new version in a new view, instead of going through my project and try to replace jqu...
I have a problem with jQuery ajax function: var arrayIdEq = JSON.stringify(iditem); $.ajax({ type: "POST", url: "index.php", dataType : 'text', contentType: 'application/json; charset=utf-8', data: { arrayIdEq : arrayIdEq }, ...
I'm animating an svg file, and in order not to bloat my code I have written the follow function: function animateSingleAtt(svgName, element, attToAnimate, attValue, animationTiming) { svgName.select( element ).animate({ attToAnimate : attValue }, animationTiming); } All paramet...
I'm trying to use the HTML validator API. The curl examples work fine for me and I can run them find in Node as a child process. Here is the code for that: var command = ('curl -H "Content-Type:text/html; charset=utf-8" --data-binary @' + file + ' https://validator.w3.org/nu/?out=json'); exec(...
Working on the Dan Abramov's excellent tutorial for Redux, and on chap 27 - Generating containers with connect() - a strange bug is occurring: First I define these two functions: const mapStateToProps = (state) => { return { todos: getVisibleTodos(state.todos, state.visibilityFilter) ...
/* Template Author : pixelhint.com Author Email : [email protected] Template Name : Magnetic ***************************************** - Fonts - General CSS - Header - Home/portfolio - Inner page - Map/Cont...
I am trying to create an gmail account. However I was able to pass all the fields but not able to click " I agree" button . Please assist me to run the test. Thanks import java.util.Iterator; import java.util.Set; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.o...
My code else { echo '<form action= "secure/index.php?ts='. $locTimeStamp .' method="post">'; } What is the best way for doing this in php, because the post method section is being processed.
Im trying to implement this plugin:https://github.com/blueimp/jQuery-File-Upload , in my grails web-app. I currently have the barebones required, but am unsure as to how I should process the information in the backend i.e: do the actual uploading. <input id="fileupload" type="file" name="files...
Hi I am currently making a menu on my website http://ubie-global.ubieportal.co.uk/. Some guys on here gave me some great advice. In the end, I couldn't use the transform code as the Position: fixed; did not work. I would like a smooth transition left to right but my code is not working. .page-wr...
I am using Basic PayPal Checkout Button (data-version-4) to do a payment against the 'sandbox'. All the code works fine until it gets to the point of 'Confirm' or 'Pay now' within the PayPal-Pop-Up (Lightbox) ... at this point the Pop-Up closes and no further calls are made to the Button (as exam...
I know how to pass data to a Bootstrap modal when using a button, using data attributes, thus I can eg pass a context of 'OPS' via a data-context attribute as: <button id="xx" class="btn" type="button" data-toggle="modal" data-target="#xx" data-context="OPS">xx</button> How do I do this if I o...
I have images in a Django/Mezzanine gallery with a description and need to grab that description and insert it into the alt text of the image when it's displayed with Fancy Box. This is the fancybox template. I've added tags into the alt="" part but nothing. Any suggestions for getting that des...
I'm using the following code to animate a vertical timeline upon user scroll. It works as it is but if fails more than desired when the user scrolls fast. I think the problem is using count and find. Can anyone figure a more reliable code for this? $(function () { var step1 = $(".step1"); ...
I am very new to Node.js and come from a Java background, and after reading a book about the MEAN stack I started a project to fix the concepts. I am building an app where you set a goal, and a chart about that goal is displayed. The goal has various entries about user progress so a linear chart...
I'm new to PrimeUI and have tried to follow steps from PrimeUI QuickStart guide. From one paragraph: In order to use PrimeElements, add X-Tag library that also includes the pollyfill for custom elements. <script type="text/javascript"src="%PATH%/x-tag-core.min.js"></script> <script type...
I am trying to use 4 div's inside in one master div to display 4 images next to each other, with "float:left;" it works but on smaller screen i am getting scrollbar, instead of that i want the images (div's) wrapped in new line on smaller screen... Here is an example of my main code for that <d...
I'm trying to change an existing click event and tie it to scrolling, using this Codepen: http://codepen.io/simbo/pen/oxprqj .addEventListener('click', this.next.bind(this)); this.$container.querySelectorAll('.rolodex_prev')[0] .addEventListener('click', this.previous.bind(this)); }...
I have a form inside the 3rd accordion panel. When the Submit button is clicked, if the verification code entry does not match, the page will reload and display a message saying "Please try again making sure you entered the correct verification code". But when the page reloads all accordion panel...
I am writing a quiz app that references an object with values, everything is working well, even though this is beginner code. Specifically, I want the first question to be replaced by the second question when the user clicks the "next question" button. But while my nextQuestion() is increasing ...
Hi Stack Overflow community. I'm a beginner in .js and jQuery and I am sort of racking my brain here. I've created an array of objects var questions = [ { question: "What is Capital of Canada", choices:["Ottawa","Toronto","Montreal","Vancouver"], }, { question: "What is the capi...
I have a short questionnaire and I want to send people that are 18 and over to 1 link, and people that are younger than 18 to another. The first question (the only one that filters) is "Are you older than 18?" and depending if the user clicks yes or no, I want that to change the URL inside of hr...
I'm using React Router v4.0.0-alpha.3 with create-react-app like so: // For react app import React from 'react'; import { render } from 'react-dom'; import { BrowserRouter, Match, Miss } from 'react-router'; import './css/style.css'; // For electron app ~ import './ReactotronConfig' import Stor...
I have this response object: payload when I console.log it is [object Object],[object Object] I am trying to use .map and need to print out the values in the below structure: getting undefined and also not able to print the values for example: {this.props.data[0].count} <div className="row"> <...
I'm creating a huge nodejs application that includes system messages, direct user messages etc. And i'm using websocket connections as well. All working fine 2 logined users can speak one with other and all messages comes immediatelly. And I have a question... If one user will open few tabs of my...
I am not sure how to explain it quite right. But like in some editor, where you can draw stuff, like floor planner. You have background. User can click (mouse down) and then move mouse around and scroll around. Like endless space for drawing. It is probably better to show what I mean - Edit floo...
With Bing Maps V8 Web Control, we have the ability to show a breadcrumb control. In the MapOptions we set to true the option named showBreadcrumb. By default it will be closed and it appears like this: However I'd like to see it open like this: Is there any option to have it open by defau...
I'm trying to produce a google motion chart in R slidify. I looked up a lot of examples online and it seems some people have successfully embedded google motion chart in an R slidify slide. Then when I tried my own using similar code, it gives me blank result. I also use the same method to produc...
I want the dropdown on my navbar to be wide enough the the text in it displays properly, but it's constrained to the size of the button you hover over to activate it. I want the dropdown to be a bigger width than the button. Here's a jsfiddle for visual reference: https://jsfiddle.net/55qggpbg/ ...
I'm new with promises and I don't know how to do this. The thing is that I will have a number of elements, and for each I will call a function that has a callback. When all this callbacks had been executed I want to execute another function. Something like this: var elements = [e1,e2, ...] //I d...
I have a problem with displaying the title in mustache. In general, the idea is that, if a page contain item #deleted-apps (some clickable div) title of "test" should be displayed. The title should be shown only once, while the #deleted-apps apps can be many. If there is no #deleted-apps title...
I have an intranet site that has been working for years on ipads. It uses XHR to poll and live update the site for the users. Recently bought the new ipad air 2s and the site is no longer functioning. On the older ipads and my desktop browser it works fine, but on the new ipads it randomly calls ...
Having trouble with a javascript function writing to HTML id img tag. In the javascripts function "pageSetup" Im trying to write to the HTML "IMG" tag that contains a random pic.Bellow Ive listed the HTML code and the function that is attached to the HTML. <!DOCTYPE html> <html lang="en"> <head>...
When the button is clicked: the div element is highlighted green, and then the green fades away. It works, but it only works every other time. The 1st, 3rd, 5th... time you click the button the animation occurs. The 2nd, 4th, 6th... time you click the button the animation does not occu...
i'm trying to get to grips with the object literal pattern by making a simple website using it. A part of this website is a contact us page that includes a map, which I'm trying to initialise using the pattern. Simple stuff, or so I thought. So the mapControl.init() function is the one that's thr...
I want to implement infinite scroll using virtual ng-repeat. But there is one caveat - I have dynamic row height. Imagine simple chat. Length (content / height) of messages may vary. I wonder how it's implemented in most messengers and G+, for example. They all had the same issue. In G+ th...
I'm trying to load a svg content with ajax by POST to enable some animations and make the image change depending on some parameters. So... if I don't want to deploy a server, is there any posibility to load the image and append all the content inline? Just to be clear: I want it to be this way: <
Is it possible to create a parallax background inside a div that has a certain width? Every tutorial I've seen has parallax backgrounds on full screen websites. My site is not full screen width, but I would still like to use the parallax effect within the content of my site. Obviously if I use th...
Let's say I have a react component that updates state from a form. handleChange(event) { this.setState({ someCheckboxState: event.target.checked, }); } Now I want to send that state to the server (or somewhere). If I just do this handleChange(event) { this.setState({ someCheckbo...
I have a nested JSON object with structure as follows: { "sensors": [{ "probe": "PROBENAME", "sensor": "SENSORNAME", "status": "STATUS" }, { "probe": "PROBENAME", "sensor": "SENSORNAME", "status": "STATUS" }] } Is there a good way to actually iterate over this...
I would like to retrieve all of the images on a web page, lets say http://www.reddit.com/r/me_irl/, using a chrome app, and then display the images in that chrome app window. I have found ways to do this with a regular website, but not using a chrome app. I have no idea where to begin besides a b...
I am looking for a simple open source VOIP library to implement an outgoing call and monetize the time spent with the client.I have searched for two days..with no luck.Below are some of API I have checked Twillo Phono SIP Asterik plivo
I'm working in react and I have here icon and I need to do this icona hover state, like in css but I need to do this in react app, Here is my code: import React from 'react'; import ReactDOM from 'react-dom'; var FontIcon = React.createClass({ getInitialState: () => { return { hove...
I'm building a cordova project which is very simple. This project has two files the html <html> <head> <meta http-equiv="Content-Security-Policy" content="default-src *; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; media-src *; img-src 'self' data:"> <...
I have the following code which doesn't work tabs.map(tabs, (tab) => ( <Tab options={{'option':{tab.key === 'value'}}}> ... </Tab> )); My problem is some.key, which is throwing an error because I'm obviously not interpolating this expression properly. Can anyone tell me what I...
I'm building an app accessing Deezer's API. If I use Deezer's API like this: @Injectable() export class DeezerService{ constructor(private _http:Http){ } dzSearch(){ console.log('Testing dzSearch() init'); return this._http.get('https://api.deezer.com/album/12720342/tracks') ...
i made a a regexp to match telephone numbers like these: 555-555-5555 (555)555-5555 (555) 555-5555 555 555 5555 5555555555 1 555 555 5555 It works. But i don't want to match numbers with no closing parenthesis like this: 555) 555-5555 This is my regexp: ^(1{1})?(\ |-)?(\()?([0-9]{3})(\ |\...
I have recently found that my autocomplete extender drop down menus on my asp.net website do not function correctly on tablets. Basically when a user clicks on the scroll bar the drop down menu closes and the user cannot make a selection. After much reading I think I somehow need to add a "event....
How do I make a ASCII 7 bell character in Javascript's regular expressions? My regex: ^[#&][^ \a]{0,200}$ The regex above causes litteraly to not take the character a instead of the ASCII 7 character. See example: https://regex101.com/r/5nMNL4/1 Even at the explanation on the right side of R...
I have a chart from highcharts.js my problem is that for example... I have a line chart with 5 values (5 points) and my chart shows the xAxis like this from value 1 to value 2: 0, 0.25, 0.5, 0.75, 1, what I want to do is to remove 0.25, 0.5, 0.75 and keep only 0 and 1, then 1 and 2, etc... someth...
I got that function that create a user in the DB, but I also check if other user does not have the same email. When the user already exist in the DB, the next() function is called twice, how can I break the promises chain and just return my function: create Note: I'm using personal methods r...
morning guys, i am learning reactjs and trying to fetch admin lists data from api server that i have built using expressjs. well here is the case. this is my action creator. export function getAllAdmin(){ return (dispatch)=>{ axios.get(`${Config.API_URL}/admin`) ....
In my EmberJS 2.9.0 test, I'm using PretenderJS and defining the following: import Ember from 'ember'; import { test } from 'qunit'; import moduleForAcceptance from 'alnahtha-fe/tests/helpers/module-for-acceptance'; import startApp from '../helpers/start-app'; import Pretender from 'pretender'; ...
I'm trying to fix a save button in a specific position, relative to an element in the iFrame. I've tried changing it's position via css, but it's not working correctly. Instead of using arithmetic to adjust it's position, I want to fix it relative to the iFrame element. Is this possible? Note: t...
So what I am trying to achieve is an interative Iframe, This iframe will coincide with the current parent url(parenturl.com) So say I have an iframe that goes to www.google.com and I click a link within said iframe. This updates the parent url to parenturl.com#www.google.com/link2, the iframe t...
I'm trying to display a table using info from a database. I can see all the data being displayed with my console.log, but I'm not sure how to then put that into a table. function displayDataTable(index){ allocationDataAjax = $.ajax({ type: "POST", url: "./qry/getAllocationData.php", ...
I've copied the demo code from the youtube api documentation to try authenticate a user. https://developers.google.com/youtube/v3/code_samples/javascript I've copied my client-id that I made and pasted it in the code but when I run it I get two errors as seen bellow. I guess that the error is...
I wasn't sure how to title this question, but I'm basically wondering if there's a cleaner way to do this: var inputElement; if(props.horizontal){ inputElement = <div className="col-sm-10"> {props.children} {help} </div> } else { inputElement = <span className="col-s...
I'm building a website and I need some animations. My problem is that I have a block with the following CSS: .description { position: relative; top: 100%; transform: translateY(-100%); } And the block is as follows: <section id="first-section"> <div class="description wow fadeI...
I want to make an Ajax call after my document is ready. Here is my code : <script> $(window).bind("load", function () { getCategories(); }); </script> <script> function getCategories() { $.ajax({ type: "POST", ...
Hello fellow programmers. I'm having a problem with transforming a response from AWS S3 to a .mp4 and then loading the content to a video tag. The script: var s3 = new AWS.S3({ endpoint: '...', accessKeyId: "...", secretAccessKey: "...", region: '...', }); s3.getObject( { ...
I'm trying to add Metronic AngularJS theme to ASP.NET Boilerplate. The problem is Metronic AngularJS theme has different version of AngularJS & jquery libraries against ASP.NET Boilerplate, so there are some conflicts. In this case, do I have to use AngularJS & jquery libraries from Metronic Ang...
This table is generated dynamically with a js function.I need it to have droppable cells. The jquery function wont work on this. I dont know how to access the cells , being that after they are generated they belong to the div with id = "table". Some help please ?? <body> <form> Rows: <input type...
After adding class colum of Bootstrap, I could not enter anything in the input field. How does that come? Using: angular.js bootstrap.min.js $scope.addComment = function() { $scope.comments.push($scope.dataObject); $scope.dataObject = { name: "", country: $scope.options...
I have a link that looks like a button because of css. My css class is: .classButton { background: rgba(0, 0, 0, 0) linear-gradient(to bottom, #818181 0%, #656565 100%) repeat scroll 0 0; border-color: #fff; border-radius: 3px; color: #fff; font-weight: bold; height: 20px...
I'm bashing my head on a very peculiar problem I just can't solve. I declared a function that I call in 2 different button click events to advance in a multistep form, one always works, the other says the function is undefined. The function is next_fieldset(button) Javascript : $("#button-pick...
I have this page designed and its an update page user can type if the wanna change something but i want to make it easier for user i want to have a drop down list for them so they can select something from that list instead of typing. This a picture of that page. this my whole page code : <?ph...
I have a Android app that uses the webview. There is a java backend server that serves up all the front end files and builds the cache manifest over apache tomcat. My problem is that I'm unsure how to get the webview to load from the app cache when the server is not connected, but the device is ...
I'm having some issues with a Jasmine unit-test seeing a global variable as undefined. I'm using Squire to mock some classes with the dependencies injected via RequireJS. Here is a trimmed down example of my unit test: My 'service' class (service.js) define(['durandal/system', 'cache'], fun...
Good Afternoon. I'm very NEW to javascript. I've done a lot of research but can not find a code to make a script compatible across all browsers. I would like this function to work in Firefox, IE, Chrome, etc but at the moment, it only works in Chrome and Older than Firefox version 49. Any help ...
I have a slideshow made of pure CSS3. It will stay only CSS, no JS at all. It automatically slides after 5 seconds (using animation), back and forth between the two images it holds. The user can also manually click a button to cause a slide (using transition). The div for the two images is as lon...
i can't make work this code : $('option[value='IL']').attr('selected', 'selected').parent().focus(); https://jsfiddle.net/5q99fzgu/ thank's
This is not the actual scenario but I have to use the check function as follows with conjunction with map object. <!DOCTYPE html> <html> <head> <title></title> </head> <body> <form action="" method="post" onsubmit="return check()"> <input type="text" name="name" id="one" oninput="change(this)" />
I am trying to set up a contact form to be sent directly to an email, I have done the code which I believe to be right, but when I hit 'Send' on my form, I am seeing the following error in the console... POST http://mysite.co.uk/email.php 500 (Internal Server Error) I will supply my code in c...
I'm making a game where a player has to navigate a map and get to an end goal. I've got the player moving and the end goal working; however after I've drawn the walls the player can still move through them. My question is, how can I stop the player from moving through the walls?
I am working on a complex dynamic form and have come across an issue with form submission. It is currently possible for a user to change multiple values - which make multiple Ajax calls to recalculate the form, and then submit the form before the Ajax returns the finished calculations. An examp...
I've been working on a pure CSS parallax effect based upon Keith Clark's implementation, and I've gotten it working the way I want it to in Chrome and Firefox, but in Edge the parallax doesn't work. I would be okay with this, since it looks okay without the parallax effect, so it fits within pro...
I'm trying to add a rotator for my Zanox links in a Wordpress website. Not finding what I need, I tried to write a hand-made rotator using Javascript however unsuccessfully. I created an array, each element contains a link to show, I generate somewhat random number and try to show that element in...
I have a parent string of which I want to replace certain entities: FIDDLE example here var parent_string = "Steven Paul Steve Jobs (February 24, 1955 – October 5, 2011) was an American information technology entrepreneur and inventor who worked with Steve Wozniak."; var entities = { PERSON: [...
Hello you beautiful people you. I'm trying to create REST APIs using node.js connected to an OracleDB, but i'm pulling my hair out trying to get these stupid bind variables working. Here's my code: app.get('/mailsummary/:SCHEMA', function (req, res) { "use strict"; oracledb.getConnect...
I am trying to create a simple scoreboard that can keep score. Can anyone help me with this? I have the first part which you have to enter score = 0 but I am confused after that
How can I make a search box that when you input for example "New York" and press enter it opens a new page with a map of New York? Using ruby on rails Similar functionality can be found in roost.com
I have a title which is displayed in uppercase letters. I would like to have just 2 pixels between this title and the framed box below. If the text is normal, there is no space, but once all ’g’, ’y’ and ’j’ letters are gone, it appears. Is there any cross-browser method of getting rid of that...
In ReactJS is it possible possible to do Animation Anchoring like in AngularJS? Check the demo here or here. Many thanks for your time and help.
we have built mac and windows desktop version of our app using electron framework, but it hangs and become unresponsive really often. Using chrome natively it does not happen. Is there any flags that needs to be added/removed when using electron framework, and what could be the difference? The bi...
I'm trying to make an image a link that users can click on, however every time I add the link to my html it messes up the styling of my page. This is the code that's messing up my page: <ul class="portfolio"> <li class="project option-1"> <div class="project-image"><a href="default.asp"><...
I have an application that takes in multiple arrays of data each or variable length. I plan on cycling through and displaying every combination of data for each array I'm given. My first inclination was to have a single number represent the state of each array since I know the number of combinati...
I have a Multiple Select Dropdown list in .aspx page. <asp:DropDownList ID="ddlProduct" runat="server" CssClass="form-control ui fluid dropdown" multiple=""> </asp:DropDownList> My Requirement is whichever product I select from dropdown (It is being populated from DB) it should show a Te...
I am trying to put something like this http://thestlbrowns.com/ loading animation into my website. Any ideas on how I would do that? thanks!
I got a small problem with the onesignal plugin for cordova. When I'm running the app for the first time on wifi it won't get user's ids if I switch on mobile data it works just fine, after this works on wifi too. this is the error i get on onesignal debugger Index.html: <!DOCTYPE html> <html> <...
What I wanna do is take the variable name $ingreso and increment it at the end to send a lot of variables with the same name but with a different number at the end,$ingreso1, ingreso2 etc, but I don't know how to concatenate it correctly. Please Help. PHP Code: while ( $cont<= 15){ ...
The concept of promises is very new for me (so far, I was working with async.each and async.waterfall) I want to use promises but i'm stuck right now. I want to get "tags" from my db. I have two tables for this : One called 'tags' with every tag in it (with an ID) and another one 'user_tags' wi...
I need to do a site redirects to a page after 21.45 to 10.00 I need a script that would do a redirect site to another page at a certain time. Here's what happened. <?php $date = new DateTime('now'); $date->setTimezone(new DateTimeZone('Europe/Athens')); if ($date->format('H')>=10 &&
I'm working on a fairly extensive local website. It is not on a web server, and I am more or less restricted to HTML and JavaScript. I have a side navigation menu on all the pages that is called with this statement: menu.js is essentially a list of links like this: document.write("<a href='p...
i'm trying to make a photo "gallery" with a little bit of Bootstrap. For now, I am doing this by saving the images in a folder called "img", then upload them directly into the code (using a modal to display it), along with a small description. <div class="col-lg-3 col-sm-4 col-xs-6"><a title="Ex...
I am trying to use jQuery and hoverIntent.js on one element called navbar as below $(".navbar").hoverIntent({ over: $(".navbar").animate({height: "100px"}), out: $(".navbar").animate({height: "50px"}) }); .navbar{background:grey; height:50px; width:300px; } <script src=...
Could anybody help me and have a look at my HTML page, and explain to me if this is a correct semantic way to set-up a HTML page? I need to learn to build a webpage with as less divs as possible, but you can use them if you want to style something specific right? like I used them in this context...
I have a problem what happens is that when you close the fancybox fails to send the data form, because this is closed very fast. <a class="button" onclick="$('#form').submit();"><?php echo $button_save; ?></a> <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id=...
I observe that In angular 2 there is no finally block for promise API angular 1 : loadUsers() { fetch('/api/users').then((response) => { return response.json(); }).then((data) => { this.users = data; }).catch((ex) => { console.error('Error fetching users', ex); }).finally(() =
If I call setTimeOut() for say, 10 seconds from now, then execute a set of long running commands, does Node.js/JavaScript wait until those commands finish executing the function set up in setTimeOut? Is the same true with setInterval()? Are there any things to watch out for if I'm suing both se...
Background Six months ago, I started doing web development, and the only thing I've done in those six months is develop ASP.NET WebForms with no JavaScript libraries except Bootstrap. Now my team is trying to come out of the stone age to .NET Core and MVC, and the abundance of tools and JavaScr...
This is probably a very basic question. But what is the difference between these two code snippets: const express = require ('express'); const http = require ('http'); And const express = require ('express'), http = require ('http');
Trying to show the #authorized_to_purchase_box if one of the seven job titles marked with data-auth="need-purchase-auth" is selected. Not sure why it's not working. Please critique/let me know if there's a better way to do this. HTML: <select name="job_title" id="job_title" onchange='showAuthB...
these are what i have, and would like to know how to put them both together in one page of code. This as you can tell is copied from a website, but let me assure you, its copyright free material Many thanks html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquot...
can someone help me, how to make uploaded images sortable??? there is a simple code, where I am using jquery to sort and upload images. <!doctype html> <html> <head> <link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> <style> #sortable { list-style-t...
We have legacy project full of templates. Some of them contain invalid HTML (with unclosed pair tags and so on) which can cause us a lot of problems. Today we were investigating why PhpBrowser in Codeception cannot click on element, which actually could be seen in regular browser for whole day. ...
I'm playing around with OAuth2 and Calendar API using Javascript. I'm using a following test function to see if the event is being added to the calendar (after authentication of the user by the API). function addTestEvent() { var event = { 'summary': 'Google I/O 2015', ...
Hi im using php and i wanna do this: <p><img alt="" src="/sites/default/files/art/w2.jpg" style="height:395px; width:800px" /></p> dele tags <p> and rewrite img tag like this: <figure><img src="/sites/default/files/art/w2.jpg" /></figure> im using DOMDocument i have this code: $doc...
Im using a especial protocol (SIP) to open a softphone trough my xhtml page using something like this <h:outputLink value="sip:123456" /> But is destroying my bean, leaving the page useless, is there a workaround for this? any ideas would be apreciated pd:i also trying with primefaces.
Attempting to load file(s) into CKEditor 4 textarea using input button and javascript. The files contain simple HTML code and have extensions .inc and .txt What I have works, BUT ONLY after using browser back/forward buttons (which a student discovered by mistake). Using the input loads file fro...
I generate a list of Magic cards from a Json file. for (i in set.cards) { leftCardElement = document.createElement("p"); leftCardElement.innerHTML = set.cards[i].points + " " + set.cards[i].name + " "; leftCardElement.addEventListener("click", leftCardClicked); }...
I have three divs, each one with some hidden content. When you click on a div, its content is being displayed by sliding down. And at the same time, I'm using scrollTop to make the browser scroll to the top of the block thats been clicked on. The HTML looks like this: <div class="blocks block1"><...
(SVG has been simplified for the sake of brevity) I'm experiencing a problem with an SVG animation that is executed on hover, and then animates back to its initial state on hover release. The animation executes fine, but the issue arises when the user only hovers briefly over the element, as the...
I don't know how to ask this... I made a layout using some css, I have a container div (.truck_info) with 2 elements inside, the first one is on the top, and the second one (.truck_cont) has a height:100% and vertical-align:middle (it covers the whole container), I don't know why the elements in...
i'm trying to draw functions with Chart.js I have a problem with my draw let's see : here This is the 'x' function and the line isn't straight I don't know if it's a problem of resolution or of interpolation So here is my chart : var scatterChart = new Chart(ctx, { type: 'line', d...
Someone please put my out of my misery with this issue. I cannot get the radio value's to echo back as checked within the conditional block, it's got to be an issue with my syntax. I know you don't have the full code but I can assure you 100% that the conditions are all true. What am I missing? <...
I am looking for a way to scroll to the first error using only the LiveValidation 1.3 JavaScript library. I see examples online of how to do it in general, but nothing for LiveValidation. This is for an Eloqua form that uses the LiveValidation script.
Okay here is part of my code and where I want to place the email alert: !/usr/bin/env python import sys from subprocess import call from pymomgo import MongoClinet from bson import ObjectId from datetime import datetime prog_list= ['network-to-ips.py'...
Currently i have an external json file and i have a function that gets that json and performs a function. I also have a text area which the user can paste a value. What i want is that whatever the user pastes into this box is taken and loaded into the same thing that the function i have is load...
What I am Trying to Do: I am trying to use settimeout to loop/run after a function is called to automatically update/refresh a div. What Isn't Working: To be clear settimeout is working, but the div is not automatically refreshing/updating when I enter new test data into the db. In other words,...
Using the Aurelia JS framework, I need to be able to detect when the results of a repeat.for over elements have been loaded completely into the DOM by code in the parent VM. I know I can inject a listener into a @bindable and trigger the listener on attached(), but that seems very hokey to me. ...
When I launch my site using the command: sudo webpack-dev-server --output-public-path=/dist/, my site displays normally: However, if I were to launch the site by clicking on my index.html file, it doesn't seem to display anything: Lastly, if I push the site through Github pages, it shows some t...
Can you please take a look at this demo and let me know why I am not able to add transition to each of .fa-chevron-right or .fa-chevron-left on toggling two classes? $("button").on("click", function(){ $('.fa').toggleClass('fa-chevron-right fa-chevron-down'); }); body{padding:30px;} bu...
var input = parseInt(prompt("Please enter a number between 1 and 100")); var array_nums = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten"]; var i = array_nums.indexOf(" "); var total= " "; for(i=0;i=1) && (array_nums[i]<
I am embarking on building a new app using Angular2 and Typescript, never having used either of the technologies together before (but have used them separately, so I have some experience). My question is how does one debug client end of the application given that Typescript compiler converts y...
My problem is that i have a listview that looks just the way i like it, when it is static coded like this: <ul data-role="listview" data-inset="true"> <li> <a href="#" id="Pizza Prosciutto"> <img src="pizza1.png"> <h2>1. Pizza Prosciutto</h2> <p>Tomatsovs, ost, skinke -
This is my HTML <td class="style1 product name" valign="top" nowrap>23$</td>, <td style="padding-left:10px;" class="product name" width="85%">productY</td> <td class="style1 product name" valign="top" nowrap>10$</td>, <td style="padding-left:10px;" class="product name" width...
I have issue in implementing the expand and collapse functionality for my html tables on the page I have following html structure <table class='css1' style='width:550px;' border='0'> <tbody> <tr><td class='heading'><span id="lblpreferredtype1">Preferred Type</span></td></tr> <tr><td clas...
Im working on a University project for a Economical Department. I have many routes working correctly, but only this one creating a massive problem for me. Whenever this route is done and the response is sent, I get the following error: Can't set headers after they are sent. at ServerResponse.Ou...
I have a multi-step form and i wanted to display the array values on the last step before submitting. I have no problem displaying form values before submit but i cant get it with arrays. Here's my approach for input values: <form id="test" method="post" action=""> <input type="text" name="Fir...
I wrote the following node.js file: var csv = require('csv-parser'); var fs = require('fs') var Promise = require('bluebird'); var filename = "devices.csv"; var devices; Promise.all(read_csv_file("devices.csv"), read_csv_file("bugs.csv")).then(function(result) { console.log(result); }); ...
I have to get value into the dropdownlist and value should be the combination of both the employeeid and employee name $(document).on("click", ".meeting-add-button", function () { var selectname = $("#meetings-participants").val(); meeting.MeetingParticipantsid=selectname; }); th...
My JSON contains descriptions formatted for a web page, however I want to use them in my app without all the HTML tags, i assume the best way is to make them read as HTML somehow so that the tags are not shown? Is there a method for converting HTML text blocks including their tags into an apps t...
I'm trying to figure out how to get the two highest variables and the variable name from a group of data. Here is what I've come up with so far in the attempt to get the first highest. var one = 5 var two = 6 var three = 5 var four = 10 var five = 2 if (one > two && three && four && five) { c...
Seems related to https://github.com/Leaflet/Leaflet/issues/2333 I turned on worldCopyJump: true to enable continuous panning, but Hawaii has negative longitude and Japan has positive longitude. Is there something I could do to show all markers in HI/Japan at the same time? Hawaii {lat: "21.2...
i have this table name Item and when i edit on one row of table it's return null value for State and City dropdownlist but in database is already added but dropdownlist show empty i don't know how retrieving selected value and here all my codes that i was used here Table Item [Table("Item")] p...
What do I need? navigationLinkClick() -> scroll body to href (for example #competition) - height of whole Navigation With most effective and correct way for React.js Example: navigationLinkClick() -> (#competition .scrollTop() - WholeNavigation .height()) My Navigation Component: import Re...
I just started learning javascript, how do i fix the overlap of number in the if/else statement. I want to use 6am to 9am to alert a certain message and i want to use 5pm to 8pm to alert a different message. <html> <head> <script> </script> <title> Javascript program</title> </head> <body> <s...
I have a javascript code that dynamically appends rows to the HTML table, and every cell in a row should contain a single unordered list. So normally, I need to also create a list in Javascript, and assign it to the cell parent. I did that, but from some reason my list is not scrollable, and the ...
I try to create something like console in my website and I want to have down sticked div with iframe which can be resizable by dragging it up edge, I created code pen `http://codepen.io/anon/pen/QGKoRY?editors=1011` it's work but not exactly as I want: Sometimes if I click yellow bar (resiz...
I have a simple app written in angular 1.5 with components using typescript. I also use the component router which is currently deprecated (but it doesnt matter for this issue). What i am trying to achieve is to toggle the 'active' class to an active link/tab. Any ideas on how i can achieve it i...
I am in Angular environment using Kendo. All I want to do is following: Take Json Produce Kendo tree using it I have tried it with simple data and it seems to work fine. But this time I have somewhat complex data and it seems like it does not work well with complex Json. I have been trying to...
I have something like this <html> <body> <h> Hello everybody, what's up? </h> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras ex arcu,consequat sit amet volutpat vitae, finibus vel massa. Sed eleifend quis justo eu auctor. </p> Swap from:<br> <input type="tex...
I am working on one assignment in which I want to display particular <p> tag on basis of, if the user is on or off and up-user or down user. Here is my html code on name dom.html I also want to take care of nested and unnested content <html> <head> <title>Welcome to gaming website</title> </...
MobileFirst 6.3.0 plugin on Eclipse. When execute the mobile application on Localhost using android sdk emulator, the messages are displayed on Logcat; but when connect to remote server the messages are not displayed. eg: WL.Logger.warn("Event source callback is already registered with...
Is it harder to check if a property exists in a JSON object versus checking if the property is null? Can you do both at the same time?
I was doing some research on JavaScript's typeof operator, and stumbled across the following weirdness: Exceptions All current browsers expose a non-standard host object document.all with type Undefined. typeof document.all === 'undefined'; Although the specification allows custom...
I have a nav bar which anchors down my page. Id like for the element on the nav bar to highlight when its clicked on and also highlight the header h2 which it links down to on the page. However, this h2 is inside an iframe and pulls src from another html file. How can I modify my jquery to hig...
Right now im my index.html page I have links to two CDN files one being a JS and the other a CSS file.. i.e. in the the bottom of my body https://somedomain.com/files/js/js.min.js and in the head https://somedomain.com/files/css/css.min.css But right now they aren't needed on my homepage b...
Ok, so I've been trying to get a grid to work on my canvas. Here's what I've got: codepen link for (var j = 0; j < rows; j++) { for (var i = 0; i < cols; i++) { var pix = new Pixel(i, j); grid.push(pix); } } Now, the problem is that on the grid array, the pixel on inde...
i have this code that is a couple of little animations. function circle_progess() { var divElement = $('div'); //log all div elements if (retina()) { $(".whiteCircle").knob({ 'min':0, 'max':100, 'readOnly': true, 'width': 240, ...
I am trying to format credit cards as users type them into the field. I've read every topic on the subject here on stack overflow, looked at tons of sites, lots of libraries and the code behind them. I want to create a simple function that will format credit cards as the user types them into the ...
I've written a Tamper Monkey script (Chrome) to pull an email address out of our Zendesk ticket, and then appended a link to lookup that user in our admin tools in another tab. It works, but only consistently if you refresh the page when you arrive at a new ticket (otherwise, you end up with the ...
I was trying to use your API for face detection and emotion recognition. I am facing the following issues :- 1. The webcam is asking for permission and is turning on but nothing can be seen as the output. 2. The detector is not being initialized after clicking the start button.Although it shows ...
I would like to detect if a user has a Chrome extension, and if so, log something to the console (I will change what it does later on, but keeping it simple for now) I only have the extension ID< I cannot modify the manifest or anything related to the extension. I have tried many things, such a...
I'm new at JavaScript so forgive me if this question has been asked. I'm messing around with jPlayer and looking for a way to advance a MP3 file forward by 15 seconds. I was able to get the file duration with var fullTime = $('#jquery_jplayer_1').data('jPlayer').status.duration; and remainingDura...
If it possible to resize the div element when a word wrap happened. For demonstration let use a fiddle from a similar question: <div class="mypost"> <div class="test">I represent the imagdfv fdvdsdfsdfve.</div> </div> .mypost { border: 1px solid Peru; margin: auto; min-width: 20...
I'm writing a basic web app in Node, Express and MySQL. Its just a basic site, where a user can create an account, view other peoples accounts, and post infomation on their profile, and I'm creating it to learn Node and javascript. So, I'm up to creating the userlist, and I've created a nice fun...
I have a textarea in my form and every time I post it, it adds an extra whitespace in the beginning (so every time I post the form and save it to database, it adds one more whitespace at the beginning) To clarify the scenario, I am adding the code for the whole cycle. First, this is how my fo...
I created a box here but the space is too much on the top and the bottom. See image here: How can I remove the extra spacing between top and bottom of the: 1.Title and the date 2. The button and the text 3. The button and the extra spacing below Here's my HTML: <div class="col-1-3"><img ...
I want to run a nodejs function daily. I have pretty much decided to use node-schedule rather than a cron job. The question is: Without a db what is the best way to ensure that I don't somehow run the function more than once? My though was to keep a log of each time I send out and double check b...
I will preface this post with I am very new to JavaScript and even newer to AWS and their services. I am currently working through this AWS tutorial and I am adapting it to fit my needs. I am not asking to make this work, as I already have it working for my needs. In this bit of code userPool....
I have the following component with a query and a mutation, but my Component does not receive the data and the mutation prop. Am I doing something wrong or missing in my code? The query does get executed though, it's just not passed down. this.props.mutate as well as this.props.data is undefined...
I used the following command to get crypto-js into my node_modules folder npm install crypto-js Then, after I had it downloaded, within my index.html file I use the following command so that I can call the CryptoJS.SHA256() method. <html> <head> <script src="node_modules/crypto-js/sha256">
Consider the following tsv file: Code k1 k2 pf_1 0.2 0.3 pf_2 0.3 0.7 pf_3 0.2 0.4 pf_4 0.1 0.6 pf_5 0.8 0.9 I 've been trying to understand how the following code works but haven't found a clear answer: d3.tsv("test.tsv") .row(function(d, i, columns){ d.total = columns.le...
I have a very simple CSS class defined to make a div larger on hover like this .resize { width: 400px; height: 300px; transition: all 1s; } .resize:hover { width: 800px; height: 600px; } I am putting a Plotly.js graph into that div using...
Is there a way that I can assert the middleware is actually attached to the route in my unit test below? The server .. var express = require('express'); var http = require('http'); var app = express(); var server = http.createServer(app); var PORT = 5000; var myModule = require('myModule'); va...
I have a site where politicians twitter profile images icons are output as part of an API that I am using. Each of these image icons have an overlay color as per the class they were assigned (originally overlay-green or overlay-red). I have since deleted these specificities so each div only has a...
I want to update a DB field. I can achieve it through the below code yet this requires the page to be refreshed and I am unable to display a message about the action outcome. I tried using some JQ scripts without success (its so cryptic to me, however, it is on my learning plan just not there ye...
I'm trying to have jqxbuttons enabled/disabled depending on whether my jqxgrid has data to display. The only way I could think of to check whether my jqxgrid is empty or not was to do something like: function CheckIfGridEmpty() { // Retrieve row data from my grid var rows = $('#myGrid')....
So for the past couple hours i've been playing with jquery and couldn't get it to work. I am able to change the title to a string like this: <script> function chngttl() { document.title = "Heya"; } ...
I need help with this error Call to undefined method Illuminate\Database\Query\Builder::attach() my Model is public function casts() { return $this->belongsToMany(Cast::class)->withTimestamps(); } My Controller public function addCast(Request $request, $id) { $this->validate($re...
really simply I need the buttons in this code to toggle closed any of the other data-target divs which might be open when the button is clicked. I tried messing around with accordion functions and so forth, the code looked fine didn't work. I'm super new at this and have spent most of the day ch...
I'm attempting to create a drag and drop file upload form. I got the drag and drop part working, but I can't figure out how to submit the file once I have it. I can't use ajax, the form needs to redirect just like an html upload form would. Here's my drag and drop code. $("html").on("dragover",...
I'm trying to fetch a product's color variation image via Stencil's Utils API and it's close to becoming a nightmare. And the supposed documentation shows exactly nothing almost... I finally managed to get a request done of a product but those options images are yet to be found... nothing in tha...
For my homework. Javascript form validation is not working correctly, I do not get errormessage from javascript. Thanks in advance! function valider() { var x = document.forms["form"]["klassekode"].value; var y = document.forms["form"]["klassenavn"].value; ...
I never have problems with scopes, but here it seems that both variables should be created just find and foo should work inside or outside the on click scope. But it's not. (function() { var Foo = function() {} #prototypes... var foo = new Foo (); $(document).on("click", "#bat", functio...
I am building my first Node.js MVC app (native node, not using Express) and having trouble displaying images from my html files via relative their paths. I'll spare you my server.js and router.js code, but here is my controller code which is basically how Im loading my views: var controller = ...
I have a div where the id = "modalBody" with a scrollbar that has some style set to overflow-y: auto; max-height: 465px; the calculation I have below works ok when I hover over the scrollbar with my mouse, click and drag the scrollbar down to the bottom, but when I click on the down arrow of ...
In WeatherForecast component I need to pass the returned value of function appColor into a property. Then the property from WeatherForecast needs to be passed into className of app component. New to react. Not sure how to pass property from child to component. class WeatherForecast extends Compo...
I have following foobar variable which is string(I get it like so by querying a webserver with $http.post): var foobar = [{param1: 'value1'}, {param2: 'value2'}]; How do I make an array out of that? If I use JSON.parse, it will provide me with an object(tried typeof foobar). But, if I then use...
In the following code, how the statement works, as this statement is the part of an javascript file. this.isSelected = function(checkTab) { return(this.tab===checkTab); }
aligning the image(400x100) left breaks the ul block: some items are on the right side of the image, some items are under the image. How to make the ul block stay together? i.e. all items are on the right side of the image. Also the image overlaps with the ul block. <img src="url" align="left"> <...
I have a website where, when visitors land on any of a several landing pages (different languages), they are given an opportunity to enter any of a number of promotion codes into a form. If they enter one of the correct codes (stored on a SQL table), they go to another page with a form where they...
I have two array in php: $kolicina =Array ( [0] => 5 [1] => 7 [2] => 5 [3] => 7 ) $array =Array ( [0] => Array ( [kodProizvoda] => 2 [imeProizvoda] => Fanta [jedinica] => litra [cijena] => 7 ) [1] => Array ( [kodProizvoda] => 1 [imeProizvoda] => Coca Cola [jedinica] => litra [cijena] => 15 ) [2] ...
This question is similar to : AngularJS ng-repeat colspan rowspan issue The format of the data is different : function Ctrl($scope) { $scope.groups = [ { name: 'Employees', members: [ { name: 'Jane', gender: 'F'} ], status: 'Active' }, { name: 'Employee...
I'm trying to build a game using primarily javascript with a django backend. Ideally the map will be huge, so I don't want to load the entire map for users but only what is around. (Similar to google maps) There would likely be 10,000+ divs, if loaded all at once. I thinking of making some posi...
I want to display text on the image when a mouser hovers over it (without using JS), I've tried playing around with the html/css and had a look on stackoverflow, still cant find a way to implement this feature. Anyone have an idea? Once again thanks for the help. The fact there is already text (...
i made a function to calculate de symmetric difference between arrays passed as arguments. I did it for two arrays and it worked. The problem now is that i want to extend the function to n variables. I think that i should calculate the symm difference if the arguments.length of the function is...
How do I get the color div to take up the full width of the parent div .starter so that the entire width is one color? I've tried everything and haven't made progress. I've isolated the problem for ease of containment. Thanks in advance! <!DOCTYPE html> <html> <head> <title>Pri...
Im building a forum using boards.net and they dont have any good style options so ive taken to their code editior to change as much as i can... right now the pageination links look horrible and i wana either make my own from scratch or find a way to alter the look of the one that they include whi...
I am trying to create a page to list vehicles for sale. I create objects based on user input of a year, make, model, photo url, and mileage. When I run this info in a ng-repeat loop I can get the url text to display, but I can't make it display as an image. I am not sure why it isn't working cor...
i would like to get the html code of a texteditor. I use this texteditor http://wrapbootstrap.com/preview/WB0BLML90 . I've a form with the texteditor inside it but when i would like to get the html code with $request->input('texteditor'); It doesn't work and whereas I gave a name to the tex...
I have the following component being returned by React. return (<li key={image.id}> <a href="#" onClick={this.getMediaId} data-id={image.id} data-class={image.src} data-owner={image.owner}> <div className="img-wrapper"> ...
I have a piece of asynchronous code that loads data and the runs a function over the retrieved data. The function that loads the original is non-trivial (it's a THREE.js ObjLoader) and the processing code is not trivial either (it's an octree library). The callback is taking hours to run and have...
« first day (1392 days earlier) ← previous day next day → last day (2725 days later) »