Questions tagged as 'javascript'

1
answer

Chrome locks with correct JavaScript loop

I'm trying to run the following code, but I can not! It's like the browser stops working. var scores = [60, 50, 60, 58, 54, 54, 58, 50, 52, 54, 48, 69, 34, 55, 51, 52, 44, 51, 69, 64, 66, 55, 52, 61, 46, 31, 57, 52, 44, 18, 41, 53, 55, 61, 51,...
asked by 31.10.2015 / 00:11
3
answers

Add a character dynamically with PHP or JavaScript

There is some function that PHP or JavaScript does that adds a character (in this case a number) when a field has only 8 digits. within input . because I have a form where there is the RG field, and the RG is composed of 9 digits plus ther...
asked by 26.05.2017 / 15:41
3
answers

show ("show") does not work in firefox

show("show") is not working in firefox. This same code works in chrome. What would be wrong? $('#conteudo').hide(); <?php if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) { ?> $(document).r...
asked by 18.11.2015 / 17:10
3
answers

Return last index of Array

I have the following code that will bring me an indeterminate list; for example 5 items. I would like to return only the last item in the list. for(var i = 0; i < data.list.length; i++){ if(Date.parse(data.list[i].date) >= dateA){...
asked by 27.03.2018 / 01:25
2
answers

Anti-adblock replacing div [duplicate]

I need a plugin for wordpress or script in which I get a message for the user who has adblock. However, I want this message to appear instead of a div. I've tried Plugins: JGC AdBlocker Detector - This does not accept style (shows s...
asked by 25.04.2018 / 16:16
3
answers

How to add one element inside another

What am I doing wrong in my example? var t = document.querySelector("#t"); t.prependChild('<div class="verde"></div>'); #t{ width: 300px; background: red; height: 300px; } .verde{ background: green; widt...
asked by 02.04.2018 / 21:27
3
answers

Is there any specific Javascript event to detect when a datalist option is selected?

In Javascript, it is possible, through onchange , oninput and related, to detect if a certain input is changed. Example: var qs = function (el) { return document.querySelector(el); } qs("#input").addEventListene...
asked by 09.05.2018 / 14:46
2
answers

Convert array that turned string into array again

I use this function to transform words into bytes, function bytesFromWords (string) { var bytes = []; for(var i = 0; i < string.length; i++) { var char = string.charCodeAt(i); bytes.push(char >>> 8);...
asked by 20.04.2015 / 16:25
3
answers

Where to save the JS from a site

When I develop a site, I always save it inside a folder called js , and the file name is usually acoes.js . What happens is that I call this file on each page. And sometimes, I create a function for a particular page, and when I'm in another,...
asked by 16.10.2014 / 14:21
2
answers

Check checkbox if value is equal to 1

Hello! Through the function below: success: function( tbl_permissao ) { obj_permissao = tbl_permissao; var permissoes = phpUnserialize(obj_permissao.permissoes); console.log(permissoes);...
asked by 21.07.2017 / 18:34