Posts by William Bruno Rocha Moraes • 989 points
36 posts
-
4
votes1
answer44
viewsA: Loops for and while javascript
the problem with the while is that the condition is never true, so the loop never turns around. as Count starts with 20, and compare if it is less than 20, this is false. about for, you need to…
-
2
votes1
answer35
viewsA: How I make a name that were created count 1
As you are changing the size of the array, each time you place an item, you can change the word size r.innerHTML += ` <tr><th scope="row">${nome.value.length}</th>…
-
0
votes1
answer8
viewsA: Send parameters of a url for other urls of the site to have these same parameters for use of variables
puts the parameters in the form action attribute: <form method="POST" action="/teste?dia=4&mes=Janeiro&ano=1948&nome=Anderson">
-
1
votes1
answer30
viewsA: How to transform pin code into PHP variable?
the default tag button, is to be type=Submit, change to type button: <button type="button">1</button> so the form will not be sent by clicking the button.…
-
0
votes2
answers78
viewsA: Why is the input type number reset when I have a value starting with "-"?
In this case making a mask, you can prevent typing. <input onkeyup="onKeyUp(this)" type="tel" name="fname"><br><br> <label for="lname">Valor</label> <script>…
-
0
votes1
answer52
viewsA: How to develop with Cooldown with Express-Session
The most secure there, is you save in the bank when was the last time the person (email) sent a feedback. ai before accepting, you check if it has been more than 24 hours, since the last…
-
0
votes1
answer29
viewsA: Editing images on a crud
When you are editing an image field, it makes no sense to try to receive the image again. Just ignore the update field if no input file comes.
-
1
votes1
answer301
viewsA: Invalid or Unexpected token
For environment variables, the = should stick to the words: NODE_ENV=Development&& NODE_PATH=C: node_modules but I don’t know if that’s the reason for the mistake. isolated codes are ok, I…
-
0
votes1
answer169
viewsA: Is it possible to inform the size of the VARCHAR in a Namedparameter?
I decided to cast in SQL. WHERE field = CAST(:FIELD AS VARCHAR(255))
-
6
votes1
answer169
viewsQ: Is it possible to inform the size of the VARCHAR in a Namedparameter?
I’m working with a tuning of an SQL Server database. Through the query below, I can see how the bank executed some of my heaviest queries. SELECT TOP 30 deqt.TEXT AS Query, last_execution_time FROM…
-
0
votes2
answers466
viewsA: How to remove error 401 message from console with Angularjs/Javascript?
.catch(function(err, status){ if (status === 401) return; console.log('algo diferente de 401'); });
-
0
votes3
answers2135
viewsA: How to put an element in Fullscreen
Hide the other elements you don’t want (display: None) so only your DIV is in full screen view.
-
0
votes3
answers106
viewsA: Limit dynamic fields in jquery
$(function () { var scntDiv = $('#dynamicDiv'); var i = 0; $(document).on('click', '#addInput', function () { if (i > 10) return false; i++; $('<p>'…
jqueryanswered William Bruno Rocha Moraes 989 -
1
votes2
answers435
viewsA: Javascript regular expression to validate user name size
The regex looks like this: /^[a-z0-9_\.-]{2,255}$/
-
1
votes3
answers72
viewsA: Javascript Doubt ( Loopin through an array using a for loop )
<p id="demo"></p> tag p with id #demo var myObj, i, x = ""; initialization of variables. myObj = { "name":"John", "age":30, "cars":[ "Ford", "BMW", "Fiat" ] }; assignment of the myObj…
javascriptanswered William Bruno Rocha Moraes 989 -
5
votes1
answer226
viewsA: How to use more than one programming language in the backend?
There are several ways to communicate different services written in different languages, I will list some that I thought now: Queue (AMQP protocol, servers like Rabbitmq, one publishes in the queue…
logicanswered William Bruno Rocha Moraes 989 -
5
votes4
answers3163
viewsA: Removing spaces in input fields
Thus: <input type="text" id="t" /> <script> var $t = document.getElementById('t'); $t.addEventListener('paste', function(event) { setTimeout(function(){ this.value =…
-
3
votes2
answers5887
viewsA: Removing part of a string - SQL Server
If you know exactly which extension, you can use REPLACE SELECT REPLACE(file, '.txt', '') FROM table; https://msdn.microsoft.com/en-us/library/ms186862.aspx or, if they are multiple extensions, then…
sqlanswered William Bruno Rocha Moraes 989 -
1
votes2
answers171
viewsA: Call function js within another and depending on the result stop the execution of the parent function
$("#btn_emp").click(function(){ if (!validarCamposSimulador()) { return false; } var valor_maximo = $("#val_max").val(); //... }); however, for this, you need the function to return TRUE if…
javascriptanswered William Bruno Rocha Moraes 989 -
2
votes1
answer42
viewsA: Print JSON.Parse
Your problem is because the content of each position is a string and not an object, so you could not access with . Token. $ node > var arr =…
-
-1
votes4
answers82
viewsA: Div occupying all the height of the page
beyond this trick of leaving html and body 100%: html, body { min-height: 100%; } your element needs to be a position: Absolute from the body. example: <!DOCTYPE html> <html lang="en">…
-
3
votes1
answer367
viewsA: Check the existence of an element by the Value attribute?
No loop needed. You can use a selector to find whether or not there is an element with an attribute and/or a value: var existsValue1 = document.querySelector('#divCheck div[value="1"]');…
-
1
votes1
answer20
viewsA: Optimized posts on Facebook Mobile
The name is Instant Articles https://instantarticles.fb.com/ There is even wordpress plugin that already does it for you.…
-
0
votes2
answers417
viewsA: Is using HTML5 tags as CSS3 switches a good practice?
No. It’s not good practice. It’s a mistake. Do not style by tags. You may for example need 2 in the same document, then stylize: header { } You’ll have to "fight" and overwrite unnecessary things.…
-
1
votes1
answer1177
viewsA: How to catch element by Jquery id?
You can pick up by . parents() regardless of the order and quantity of elements. As long as the father is always a li: var $parent = $(this).parents('li'); https://api.jquery.com/parents/…
-
2
votes1
answer1758
viewsA: Query parameterized with Node.js and knex.js
One option is you split the string with a conditional: let select = knex.select() .from('contrato as c') .innerJoin('empresa as e', 'e.idempresa', 'c.idempresa'); if (req.query.concluido) { select =…
-
3
votes1
answer147
viewsA: Sync php and ajax
it is possible to correct the error with a safecheck in your php: if ($_POST['selectComponentes']) { //.. faz a consulta } however, note that the ideal is that ajax asks for another file and not the…
-
0
votes2
answers5270
viewsA: How to align paragraphs next to the image in HTML and CSS?
Just give float: left in the image <figure id="img" style="float: left"> <img src="img/fsociety.png" alt="fsociety"/>…
-
0
votes1
answer596
viewsA: Crud with php ajax
just search on the page where the record is the sample, ie I I have to next to search on the other page! This is really expensive, because the search is only on Frontend. You have to do this search…
-
0
votes1
answer141
viewsA: Rewriterule does not work with a specific word
There is no need for those commas, and your problem is the order of the statements. Try this way: RewriteRule ^busca/([a-z0-9A-Z_-]+)/([a-z0-9A-Z_-]+)?$ buscador.php?log=$1&id=$2 RewriteRule…
mod-rewriteanswered William Bruno Rocha Moraes 989 -
4
votes1
answer58
viewsA: Not returning the second parameter
This is happening because. * is a very greedy regex, because it marries everything, including with the / bar, so you cannot separate the parameters. The correct is to improve this regex. Example:…
-
1
votes1
answer436
viewsA: Jquery stops working after running the load command
This is because you remade the GIFT, and the events were not tied to the elements after the new GIFT was created. Utilize Event delegate $('body').on('click', '.sua-class', function() { //... });…
-
0
votes3
answers190
viewsA: Ajax upload does not send image and parameter
The mistake Uncaught TypeError: undefined is not a function, is why the plugin was used ajaxForm, and you didn’t care about him. If you want to continue using jQuery without plugins, put one:…
-
7
votes3
answers3833
viewsA: Return in hours the difference between two dates in JAVASCRIPT
> df/1000/60/60 df divided by 1000 (to return the number of seconds), divided by 60 (to return the number of minutes), divided by 60 (to return the number of hours). If you want in days, divide…
javascriptanswered William Bruno Rocha Moraes 989 -
1
votes2
answers564
viewsA: Edit data from Nodejs
How do you want a PUT, you need the module method-override And then yes: form(method="POST", action="/usuarios/edit/#{value._id}?_method=PUT", role="form") Formerly the method-override was part of…
-
4
votes1
answer283
viewsA: lightbox on page loaded with ajax
You can only instantiate a lightbox after its html exists. $("#center_content").load( href +" #center_content", function() { //aqui dentro você dispara o lightbox });…