Posts by Felipemeida • 194 points
13 posts
-
0
votes1
answer28
viewsQ: Equivalent to in_array() to use in Javascript
To know if a variable is in an array. There is something I can use as if it were PHP in_array in Javascript? Example of how it would look in PHP: $cores = ['azul', 'verde', 'amarelo'];…
-
-2
votes2
answers93
viewsQ: How to Loop a Java Object
An object does not have the same behavior as an object during a Javascript loop. That example: let obj = { casa1: { cor: 'azul', quartos: 2, }, casa2: { cor: 'vermelho', quartos: 4, }, } Does not…
-
0
votes0
answers21
viewsQ: How not to duplicate a common component attribute (in the HTML part) in Vue.js
I need to instantiate in Vue.js several times the Servicehub ->component I’m making a communication between two compelling relatives I will always have to add the assignments below:…
-
0
votes1
answer138
viewsA: How to download file instead of opening in new tab?
Add the download attribute to your tag <a href="exemplo.png" download> if you want to put a suggestion name in the image <a href="/path/to/image.png" download="exemplo.png">…
javascriptanswered Felipemeida 194 -
1
votes2
answers57
viewsA: undo the click event when selecting the next item
I always choose not to publish code so I put only one step, I’m not sure if that was the result <ul class="nav nav-tabs justify-content-center" role="tablist"> <li class="nav-item">…
-
-2
votes1
answer46
viewsA: Slow page to load
You need to limit the number of rows in your table. There are several ways to solve. Adding some filter to not list as much data; Limit the number of lines Make asynchronous calls with Javascript to…
phpanswered Felipemeida 194 -
0
votes2
answers56
viewsA: Question about GIT and how to use an existing project on the server?
I don’t understand perfectly, but if you want to update the files after added. use the command inside the main folder of the project git pull origin master
-
2
votes2
answers57
viewsA: undo the click event when selecting the next item
Suggested code organization based on what was sent. This way it becomes much easier for you to change the image that is selected and your code becomes more cohesive. let imagens = [ { imgPrincipal:…
-
1
votes3
answers551
viewsA: Ternary operator Vue.js within Tag
I modified the above answer just to give a complement. But I followed the idea of @pedroolavo <div> <select name="select" v-if="multiple" multiple> </select> <select…
-
-1
votes3
answers551
viewsQ: Ternary operator Vue.js within Tag
I am creating a Vuejs Component that I want to send a property to Component to display or hide an attribute inside the tag using ternary operator. Double Quotes do not work inside the tag. The…
-
0
votes2
answers73
viewsA: How to use multiple unique "if" in PHP?
Can be alternatively solved with a Switch as it has only one condition in if if (!empty($_GET['faixa_de_preco'])) { $valor = $_GET['faixa_de_preco']; switch ($valor) { case 1: $result = "<…
-
1
votes2
answers519
viewsA: Passing Parameter in URL using JSON + AJAX
<!DOCTYPE html> <html> <head> <title> PHP Trabalhando com Arrays</title> <meta charset="utf-8"> …
-
2
votes8
answers34672
viewsA: Convert every first letter of every word into uppercase
In this solution it is good for proper names to avoid that prepositions become uppercase. function processString(text) { let loweredText = text.toLowerCase(); let wordsArray = loweredText.split("…
javascriptanswered Felipemeida 194