Posts by João Victor Souza • 343 points
26 posts
-
1
votes1
answer59
viewsA: Make dynamic calculations in JS and display in a PHP list
Document.getElementById always takes only one record, for imagining that the id will be unique on the page, to take several elements use instead Document.querySelectorAll("#first"), being the #…
-
0
votes1
answer41
viewsA: I can’t handle exceptions in the Controller on an ASP.NET API
The GET method does not work because in your signature it was placed that it should return a Project (public Project Get(int id)) and that’s not what happens when an exception is made, you can…
-
0
votes1
answer129
viewsA: (Sequelize) Cannot read Property 'title' of Undefined
The error is happening in the information query apparently, you just put the settings of the models, post the code where the query in the database is made to get help, but there is something you can…
-
2
votes1
answer44
viewsA: How to return a JSON in ASP.NET API that has another JSON inside?
If you are using EntityFramework, properties that are also being mapped within the entity need to be included in the query, try something like: context.Project.Where(i => i.CourseId ==…
-
-1
votes1
answer65
viewsA: How do I make a loop only continue after an if is performed!
You can try working with Yield, you run a loop and return an object that has the next item of the loop method next() see here The keyword Yield is used to pause and summarize a Generator Function…
-
0
votes3
answers274
viewsA: How to manipulate the DOM of a page before it finishes loading?
First change the property of all your src images to data-src and add a new src with your placeholder. Change the page load script to the following const images = document.querySelectorAll("img");…
-
0
votes1
answer20
viewsA: I need to create a route that changes the project title with the id present in the route parameters. But when testing the route I get error 500
Give a console log on Projects before setting the project variable, your array is probably empty, find returns Undefined when the filter is not satisfied, find is not finding a project with this id…
-
0
votes1
answer20
viewsA: how to do to search the right code? because when I register a code, at the time of the search I type any value and the product I registered
Add one more variable exclusively to pick up the typed code int id_digitado = 0; Then replace the variable that receives the informed code printf("digite o codigo do produto: ");…
canswered João Victor Souza 343 -
1
votes1
answer64
viewsA: Close toggle menu by clicking on an item in the navigation
The last if checks if the click target was an 'anchor' and if it is not to show, then arrow the style display property as 'None'. const menu = document.querySelector(".menu-toggle"); let show =…
-
-2
votes3
answers274
viewsA: How to manipulate the DOM of a page before it finishes loading?
This example can help you, the getInView function takes the elements that are inside the scroll at the moment, can do this to load the images dynamically and then set a right property in html as…
-
0
votes2
answers44
viewsA: Accessing HTML elements in the Array
The example of @Noface using Chidren to get the child elements solves the problem, but I would suggest a more functional and declarative approach. To understand more about the Destructuring using in…
javascriptanswered João Victor Souza 343 -
0
votes1
answer93
viewsA: Return the Array to green. When the button is clicked, return the value immediately above the button
Use full screen mode (function(win, doc) { var f = doc.getElementsByTagName("script")[0]; var j = doc.createElement("script"); j.async = true; j.src = './tagueamento.js';…
-
0
votes1
answer120
viewsA: Get JSON return from a URL within the function
First set in your javascript: $.urlParam = function(name){ var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href); return results[1] || 0; } Then use: var…
-
0
votes3
answers119
viewsA: targeting users validated by php
You may not need the page separador.php, you can simply use the header to take you to the right place, like this: //Depois de receber o nivel do usuario na session defina a qual pagina será…
phpanswered João Victor Souza 343 -
1
votes2
answers273
viewsA: How to make an if-type validation in a set of options?
You can use logical operators && (and) or || (or), but you still have to do the individual checking of each item. You can try something like: if(val1 != "" && val2 != "" &&…
c#answered João Victor Souza 343 -
0
votes1
answer157
viewsA: I need to play a php variable in javascript
As you are receiving the ID dynamically, the ideal would be to receive the ID in the functions: //Receber o ID nas funções <script language="javascript" type="text/javascript"> function…
-
3
votes1
answer179
viewsA: What does PDO Prepare do when we use it?
According to the PHP documentation on php.net Calling PDO :: prepare() and Pdostatement :: execute() for instructions that will be issued several times with different parameter values optimizes the…
-
1
votes2
answers209
viewsA: Why isn’t the break working?
In the first for you are setting the variable aux as false, so when it finds the position of the number in the second matrix for and puts the variable aux as true he comes out of the second for and…
-
-1
votes4
answers4547
viewsA: How to Merge 2 or more Json Objects into Only 1
You can put them in a Javascript object, it would look like this: //JSON //Se estiver usando json_encode do php //Vai receber algo parecido com isso. var obj1 = {"nome":"Carlos","id":"140"}; var…
-
0
votes2
answers53
viewsA: How do I save to the database when a "user" or "admin" edits or registers a new item?
I think what you’re looking for is this Triggers You can create a new table of logs and every Insert, delete or update the Rigger created in the database automatically adds in the table logs the…
-
0
votes3
answers590
viewsA: How to remove apostrophes from a variable
Try adding the escape character \ Would look like this: DECLARE @ProdutoNome VARCHAR(30); SET @ProdutoNome = REPLACE(''ADESIVO 478'', '\'', '') PRINT @ProdutoNome…
-
2
votes3
answers619
viewsA: if error inside if
Take and put values in the input with .value instead of .val() Try document.getElementById("elemento").value
-
1
votes3
answers58
viewsA: Is it possible to use Jquery to animate Background-color?
I believe that with Jquery is not even possible, but you can use CSS $(document).ready(function() { $("#janela").addClass("animar"); }) #janela { width: 100px; height: 100px; background-color:…
-
0
votes3
answers73
viewsA: Error in jQuery animation
You can also use own css for animation and put it as Infinite you only need to call the function once with setTimeout function moverFoto() { $("#janela").addClass("animar"); } $(function(e) {…
jqueryanswered João Victor Souza 343 -
0
votes1
answer111
viewsA: Difficulty printing lines from a table using PHP and MYSQL
Use or die($Conn->error) to see what’s wrong $query=$conn->query("SELECT * FROM tb_pedido Pp INNER JOIN tb_cliente C ON Pp.codCliente = C.codCliente INNER JOIN tb_funcionario F ON…
-
-1
votes1
answer373
viewsQ: Instantiating a class in another constructor in PHP?
I have a class called teacher who is heir to another so-called person, I am trying to instantiate a third class of connection with bank in the method constructing the Teacher class, but it is…