Posts by Otavio Fagundes • 978 points
58 posts
-
-1
votes2
answers27
viewsQ: Conditional returning error in Reactjs
My reactjs app only works if I remove the conditional. I figured it might be Babel’s fault, but if it was, JSX wouldn’t work even without parole. App.js: import React, {useState} from "react";…
-
3
votes1
answer60
viewsQ: How can a value be invoked (as a function) at the same time as it contains properties (as an object) in Javascript?
I was left with a question concerning the structure of the Express. How Express can be invoked, as in express(), but can also have in its structure access to the Router property, for example? I…
-
-3
votes1
answer90
viewsQ: Convert Real values to USD
I have some string values in the following format? 1.599,90 I need them to become a dollar value, like the below: 1599.90 I tried to convert to float, but the value obtained is not correct:…
javascriptasked Otavio Fagundes 978 -
10
votes3
answers195
viewsQ: Why do I need to spend two then on AJAX requests made with the fetch API?
In the example of the following request: fetch("https://viacep.com.br/ws/01001000/json/") .then(resposta => resposta.json()) .then(json => console.log(json)); In the first then should not…
-
1
votes0
answers35
viewsQ: Video and text connection between two or more Webrtc people
I’ve researched a lot and most of the well explained content I found is in English, especially in videos (I don’t have enough knowledge to understand a video in English). I need to create a Webrtc…
-
1
votes2
answers634
viewsQ: Select the first occurrence of the class using css
If I take the first paragraph containing the class .oculta works, but otherwise the selector nth-child does not work. Both the nth-child as to the first-child do not work for some reason, even…
cssasked Otavio Fagundes 978 -
-1
votes1
answer25
viewsQ: catch how much a video has already been uploaded (buffer)
How can I get the value of how much a video has already been loaded (buffer)? Example: Assuming I have a 5-minute video, then I agree that I will be watching it is being loaded, but how to get this…
javascriptasked Otavio Fagundes 978 -
0
votes1
answer35
viewsQ: Recover element instance after it is rewritten
I have an HTML element and this element has an interaction with Javascript, but after performing a certain task this element is totally rewritten and with that my instantiation stops working. I…
javascriptasked Otavio Fagundes 978 -
0
votes1
answer2124
viewsQ: Difference between Webservice, API and Restful
I can’t tell the difference between them. All three are web services that can work with data externally, but I can’t understand the difference. Restful works with json, but so can the API and…
-
0
votes1
answer32
viewsQ: What are colors and routers in various PHP frameworks
I’ve always used PHP without a framework. I use the MVC standard, but I only created a pro view folder, a pro controller and a pro model, but recently I decided to study a framework and it uses such…
-
2
votes2
answers68
viewsQ: Flexbox width being exceeded
I have a flexbox page, but one of the items I need to stay fixed at the bottom of the page and have the same width as the other items, but it exceeds the standard width. html, body {width:…
-
0
votes2
answers48
viewsQ: Count difference of months between dates
I took this example right here, it works, however it does not work the way I expected, I need to take the amount of months between dates, but the result does not come out as expected, in the example…
phpasked Otavio Fagundes 978 -
-2
votes3
answers118
viewsQ: Comparison between month and year
I need to compare only the year and month between two dates, I did it the following way and it works perfectly: $mes1 = "2018/02"; $mes2 = "2018/03"; if($mes1 > $mes2) { echo "Mês 1 é maior que…
phpasked Otavio Fagundes 978 -
0
votes1
answer32
viewsQ: Reference an array value within itself
I have a function within a class, and within that function I have the following vector: $compra = [ "produto" => "Chocolate Nestle", "preco" => 5.5, "frete" => 1.5, "total" =>…
phpasked Otavio Fagundes 978 -
0
votes1
answer226
viewsQ: Sum with javascript returning wrong value
I have some fields on my page and they have values, I take these values and we are, it turns out that the value goes wrong, as I take them from the DOM and end up coming as string, I convert into…
javascriptasked Otavio Fagundes 978 -
-2
votes1
answer63
viewsQ: Send email at the end of each month
I have a user subscription system, I need to send a notification every end of month warning that the subscription is coming due, the problem is that I don’t know how to make this script run…
-
2
votes1
answer1263
viewsQ: What is the difference in storage between session, cookies and localstorage?
Where is the storage location of each of them? the local storage I heard it’s from html5 and it’s better that session and cookie, what the difference between them?…
-
0
votes1
answer45
viewsQ: What is the difference between setAttibute, getattribute and hasAttribute?
hasAttribute is the evolution of getAttribute and setAttibute? I am learning Javascript but I am in doubt about what each one does, the getAttribute I know it takes an attribute, seAttribute I know…
javascriptasked Otavio Fagundes 978 -
0
votes0
answers26
viewsQ: What’s the difference of using + and ~ in CSS
Is there a name for this type of selector? do the same thing? example: #mostrar:hover + #esconder {} and #mostrar:hover ~ #esconder {}
cssasked Otavio Fagundes 978 -
4
votes3
answers10029
viewsA: innerHTML VS innerTEXT
The innerText works in a similar way to textContent. The innerHTML can add or pick up elements HTML, already with the innerText this is not possible, it can only assign a text or grab the text of a…
-
1
votes1
answer86
viewsQ: Capture rel of each clicked link and add to the value of an Hidden input
I have the following structure, I need to create something "similar" to a shopping cart. When creating a link I need to take the rel of this link and go adding the value of the Hidden input,but I do…
-
6
votes2
answers247
viewsQ: Infinite scroll on one page with static data
I have the following extrusion and want to limit the amount of "class/posts" to be displayed. I want to create a button so that, when clicking, it displays and goes showing more and more…
-
0
votes0
answers14
viewsQ: How can I set the list order in the list.js library
I am using this library to filter data in searches, so far so good, but I need to click a select for the person to choose whether to define the order of the listing in an additional or decreasing…
javascriptasked Otavio Fagundes 978 -
1
votes1
answer210
viewsQ: Search with multiple filters
I have this structure, how can I do so that I can have a select that gives me higher or lower price options? this script it only lists the data by category, I do not know how to implement so you…
-
1
votes1
answer483
viewsQ: Vertical and horizontal alignment do not work on bootstrap 4 with flexbox
I’m doing a bootstrap course 4, the teacher uses and teaches that there is a class flex-items for alignment, to align vertically for example, we could use something like this: flex-items-md-middle…
-
-1
votes1
answer46
viewsQ: Count database records without repeating
I have a table that has several records with the same information, example: id | nome | profissao 1 Carlos Pedreiro 2 Jean Garçon 3 Victor Pedreiro 4 Ana Paula Secretaria 5 Paula Secretaria 6 Karina…
-
1
votes0
answers32
viewsQ: Cookie path does not work
I create a cookie with javascript, until then beauty, but when I use the path it simply stops working, so it works: document.cookie="gravado=sim"; the problem is that this way I can’t access it by…
-
0
votes1
answer1689
viewsQ: Check if cookie exists with Javascript
I have a cookie set with javascript, I created it like this: document.cookie='gravado=sim' I don’t know how I’m gonna make sure he exists. I need to make a check because if it does not exist, I will…
-
0
votes2
answers516
viewsA: Insert with PDO and INNER JOIN
Can you give me the last help? I decided to put another table, this time called selecto, but it’s giving error: "begin; insert into time (meu_time) values ('cruzeiro'); $time = last_insert_id();…
-
0
votes2
answers516
viewsQ: Insert with PDO and INNER JOIN
I have a table person who owns the fields name, city and phone and time_id. I also have another table with a team name and in it I have a field called meu_time, as I can do an INNER JOIN to register…
-
1
votes2
answers35
viewsQ: When assigning an attribute to a function, is it like creating a variable within that function?
I’m studying Javascript and, as I understand it, when assigning an attribute to a function, it’s like creating a variable within that function, that’s it? For example: Original function: function…
javascriptasked Otavio Fagundes 978 -
1
votes0
answers59
viewsQ: Shorten url when linking files and pages with php
Good afternoon, I need some help from you...I want to know how I can decrease the path of the url to link files and pages with php, for example, instead of typing something like:…
phpasked Otavio Fagundes 978 -
2
votes1
answer44
viewsQ: Prevent indexing of page clippings
If you cut a page separating the head,nav, etc... and pull everything with include in the index.php, Google will index these cut pages? I want to separate some parts by creating head.php and…
-
2
votes1
answer1172
viewsQ: What it’s for and how to use include_path in php
I have picked up many scripts using include_path, the problem is that the explanation of php.net I find a little confusing, I’m not getting to understand how it works and what it’s for, help me…
phpasked Otavio Fagundes 978 -
1
votes1
answer842
viewsQ: Fatal Error: Uncaught Error: Call to Undefined Function getList()
I need to reuse this function so that it uses fetchAll but also use num_rows, the problem is that if I return fetchAll or num_rows it works, but in that case I would have to create two functions…
-
3
votes2
answers676
viewsQ: Inc and MVC extension in PHP
I know you don’t have to use codenames inc and class in the name of the files, but because of the same organization is recommended. The doubt is due to the fact of the codename class it is easy to…
-
0
votes1
answer3372
viewsQ: Error Call to a Member Function prepare
The connection to the bank is working perfectly, but the getList method returns me this error: Fatal error: Uncaught Error: Call to a member function prepare() on null in…
-
2
votes1
answer719
viewsA: Image exceeding grid bootstrap size
Guys I managed to solve as follows: I gave a Hidden overflow inside the tag that defines the grid and not in the image itself, so it worked, I’ll show you how it looked: <div class="col-md-2"…
-
2
votes1
answer719
viewsQ: Image exceeding grid bootstrap size
I set a grid and inside I played an image, that image needs to have a height of 150px, so I set it to height to it, the problem is due to the fact that the image is exceeding the grid, I do not want…
-
2
votes2
answers311
viewsQ: Extended PDO connection does not work
The netbeans IDE does not show any errors, but when I try to run it always gives error in the browser, does anyone know what is wrong? can tell me how to use connection with father class builder…
-
0
votes0
answers123
viewsQ: Remove class giving transition effect
Guys I have a class called 'Fixed' with a Transition in it, when I add this class it makes a transaction, the problem is that when I remove this class, it is being removed very roughly, do not know…
-
4
votes3
answers792
viewsQ: Add class after the page is loaded
I’m having a problem, I’m trying to add a class of Animate css to give an effect when I finish loading the page, but it’s not working, it seems he’s adding the class before the page finishes…
-
3
votes2
answers21
viewsQ: Last elements of a class running incorrectly
See this print that you will understand what is happening: http://imgur.com/a/B0zkV I’ve checked the code several times and apparently found no error, follows the html and css part of this class:…
-
0
votes1
answer43
viewsQ: jQuery adds class, but does not remove
I am using this code to add a class to leave a fixed menu. The problem is that it is not removing the class afterwards. How to proceed? $(window).on('scroll', function() { if ($(this).scrollTop()…
-
0
votes0
answers24
viewsQ: How to pick the position of an id with jquery to assign an effect when scrolling?
I want to make these very common effects on websites that when scrolling up to a certain id or class it makes an effect, I don’t know how he knows that arrived in such part of the page, someone…
jqueryasked Otavio Fagundes 978 -
1
votes2
answers77
viewsQ: PHP comparison does not work
Guys I’m with a problem, the comparison is not working, He should return the message "All right" but ends up returning only the message "Valid only numbers 1 a 60" <?php $a = array(1,2,3,4,60);…
phpasked Otavio Fagundes 978 -
1
votes2
answers115
viewsQ: Transition time does not work
I gave 3 seconds to make a more sensitive transition but it doesn’t work, it’s too gross: $(function(){ var status = 0; /* INICIA MENU-GRID */ $('.menu-grid').on('click',function(){…
-
3
votes2
answers238
viewsQ: Image Modal only works with the first
I have a modal of images but only works with the first one, can anyone help me ? see the modal here: https://jsfiddle.net/pnavtmcx/…
-
2
votes2
answers109
viewsQ: Searching in array using more than one word
I want to search one array and use more than one word, the problem is in the fact that I want it to only return something to me if there are all the words in array and not just one, I’m doing it…
-
2
votes2
answers611
viewsQ: Ajax does not return the date of requests
I perform a query with ajax on a php page, the problem is that even asking to return data, the ajax 'date' does not return anything, I give an Alert in the 'date' and it returns me a blank alert, JS…