Questions tagged as 'javascript'

1
answer

Angularjs - test $ timeout on the callback of an asynchronous function

I have the code for the following asynchronous function: obj.save({ success: function(data) { $timeout(function() { defer.resolve(data); }); } }); And in my test I have: var $rootScope, $compile, $timeout; beforeEach(in...
asked by 23.02.2014 / 00:21
1
answer

Bootstrap popover with table-responsive

I'm using Bootstrap v3. And I need to filter the fields of the tables. I chose to use this example as a basis. I am now having a problem, when I am viewing my table (is table-responsive) on a mobile device, what happens is that the filter b...
asked by 02.04.2014 / 12:24
1
answer

Put soft effect or slowness in anchor (window.location.href) [duplicate]

I have the following code: if($('#otherfilter').is(':visible')){ window.location.href='#otherfilter'; } I would like to slow him down to make this anchor.     
asked by 28.09.2017 / 19:26
2
answers

How to make a date field containing only Month and Year Html

I need a date field containing only Month and Year Html, preferably on the screen something like a calendar containing only the months and years. obs: I'm using angularJs, javascript     
asked by 21.09.2017 / 23:10
2
answers

Paste JS values for PHP [duplicate]

I have this code. However it is in JS and I would like to play the values for a var in PHP and work better with Front End. <script language="javascript"> var LIP_LowPrecision = false; //false = pede permissao pelo navegador, M...
asked by 29.10.2016 / 06:29
3
answers

How do I set default value in a form via javascript?

I would like to set a default value in a given field of a form via javascript. Let's assume that the field id is #code.     
asked by 24.04.2018 / 14:40
4
answers

PHP ask for confirmation before deleting

Hi In a course I'm doing the person did not teach how to delete a record in the first bd ask for a confirmation before deleting. So I made this code. <?php session_start(); header('Content-Type: text/html; charset=utf-8'); include_once("...
asked by 07.08.2016 / 17:12
4
answers

Set a range in the execution of each loop of a for

I want to set a gap in the execution of each loop in my for var li = document.getElementByTagName("li"); lengthLI = li.length; for(var x = 0; x < lengthLI; x++){ console.log(li[x].innerText); // setar intrvalo } How could I be ab...
asked by 04.03.2018 / 05:00
3
answers

Object for a javascript array

I have an object with the following values: let sel = { "1": { "id_turma": 485, "codigo_turma": "1112A - 41", "ano_ciclo": 14 }, "2": { "id_turma": 486, "codigo_turma": "1112B - 27", "ano_ciclo": 18 }, "3": { "id_turma": 487, "c...
asked by 14.08.2018 / 18:54
1
answer

Difference between two functions that execute only once in javascript

I searched for a script that did one function only once and found the function below var something = (function() { var executed = false; return function () { if (!executed) { executed = true; al...
asked by 06.07.2017 / 12:41