Questions tagged as 'javascript'

5
answers

Add character in the middle of a string

Problem How to add character in the middle of a javascript string? For example: var string = "aacc"; // eu quero colocar as letras bb no meio da aa e cc I want string to have this value aabbcc How can I do this?     
asked by 23.04.2014 / 19:20
4
answers

How to know the highest value of an Array?

I'm doing 1 calculator that adds values entered by the user and when the values of the sums reach 1000 or exceed, the loop ends. So far so good, the problem is to be able to identify the highest value entered by the user Each time the loop...
asked by 08.10.2014 / 04:54
4
answers

mount a regular expression

I would like some help from you to put together an expression to check if there are more than 3 bars inside a url in javascript. example: link , this one it does not catch. link , This one it catches. I will use the expression in the test () m...
asked by 13.10.2015 / 06:29
2
answers

How to prevent the page from opening outside of an iframe?

Can not open link in iframe if (self != top) { top.location.replace(window.location.href) } I need something in javascript that runs counter to this. I want my URL to work only inside an iframe     
asked by 03.02.2016 / 14:50
1
answer

How to maintain multiple connections to postgresql in Node.js?

I'm using Node.js in a task where I need to migrate data between two PostgreSQL databases. The idea is more or less as follows: Connect to Bank A. Connect to Bank B. Return all records of A. Insert all A's Registers not yet present in...
asked by 27.10.2015 / 14:05
2
answers

How to make a function wait for jQuery loaded with the async tag

I have a problem to make a function wait for loading the package.js with the async tag <script id="packjs" async type="text/javascript" src="pacote.js"></script> This file contains jQuery and some plugins. The problem is that wh...
asked by 27.11.2015 / 12:36
3
answers

Bind JavaScript

I wrote this code as a study for the understanding of bind. I create a method in an object and try to call it by changing the scope to another object. let car = { sound: 'Vrrrrummm', startEngine: function() { console.log(this.sound)...
asked by 15.11.2016 / 06:07
2
answers

How to make this hover effect?

The hover effect of this site's menu: link Is CSS3 pure? How to do something similar?     
asked by 24.10.2016 / 22:00
3
answers

How to format date in Javascript by putting name of the month and day of the week

Hello. Home Have this date: 05/18/17 . Home And I need to convert it to this: May 18th (Thurs) Home May: May, (Thurs): Thursday Home Does anyone know how I do this using JavaScript and jQuery?     
asked by 16.05.2017 / 20:08
3
answers

Why does Javascript return Infinity instead of error when dividing by 0?

When I divide any value by zero, Javascript returns me Infinity . My question is why Infinity ? Infinity is defined in Javascript, but I could not find a use for it in any case. Can someone tell me too, what would be the use of...
asked by 21.06.2017 / 16:21