Questions tagged as 'javascript'

4
answers

Javascript URL redirection code

I need to develop a javascript code that is not working. My need is as follows: When the user accesses a certain page, I would like to supplement the URL with some parameters, eg: If the domain is xxx.com.br/index.php, redirect it to xx...
asked by 05.12.2014 / 14:40
3
answers

How to 'break' a text at each character range - Javascript

I would like to know how to 'break' (split function) one text every 8 characters in javascript for example: var teste = '1234567898' teste.split({a cada 8 caracteres}) //retorna ['12345678', '898']; Thank you in advance.     
asked by 18.12.2014 / 19:57
2
answers

Location of a point within the range of an arc

I'm looking for a Javascript function that returns a random value within a range in the area of a circle. The interval would be along the radius with distances equivalent to the center point and the radius endpoint, also considering a range of d...
asked by 21.01.2015 / 18:27
2
answers

javascript function duplicating firing by init method

I have a function in my main menu that, when clicked, starts a 'classe' for the sector in question, everything happens well, however, I need to start the same class again when someone returns to the sector, and in that, the methods have t...
asked by 27.10.2017 / 14:29
2
answers

Calculating average time

In my database I have a table that has the fields entrada , saida , the two fields have the format D-MM-YYYY H:M:S , I would like to do an average calculation. Ex: The average wait time is 30 min Based on all the results...
asked by 04.09.2017 / 14:52
2
answers

How to identify a number (in words) in a phrase

I need a script to identify a number in a sentence. Ex: " Two weeks ago" - > number = 2 It can be even by replacement even. So: If str contains two , replace ("two", 2) Is there a node module that does this? I have already sea...
asked by 25.07.2016 / 01:07
3
answers

Javascript - Line break in .txt file

How do I identify a line break in a txt using javascript? Example: Essa é a linha 1 Essa é a linha 2 Essa é a linha 3 The file has these 3 lines and I want to put them in an array separated by the line break, array [0] is line 1, array [...
asked by 20.07.2016 / 16:29
1
answer

How to Detect DOM and API Resources

How to tell if your browser supports certain methods , properties and events Checking whether an object querySelector , querySelectorAll , addEventListener , classList exists via Javascript. I've been trying so...
asked by 02.07.2016 / 05:46
2
answers

Paste string between bars

I need to get the string that is inside the last two bars (heDA6Yu7hsc) with javascript. How to proceed? https://i.ytimg.com/vi/heDA6Yu7hsc/img.jpg     
asked by 26.09.2016 / 18:34
1
answer

two functions within the onchange

Colleagues. I'm trying to put two functions inside the onchange, but the functions only work when I take one or the other. onchange="soma(); alterar();" How could I solve this? Thank you!     
asked by 23.09.2015 / 17:32