Posts by Maycon F. Castro • 1,025 points
62 posts
-
0
votes1
answer62
viewsA: Error in function to return Querystring in Javascript
Friend what is happening is that in your array lArray you are added a key and then are trying to fetch it under another name. Change the following line: lArray[lQueryValue[0]] =…
-
1
votes1
answer221
viewsA: Unable to convert int to string C#
Try it this way: public static List<Led> GetStatus() { try { using (conn = new NpgsqlConnection(Conexao.GetConexao())) { conn.Open(); string sql = "select * from led"; using (NpgsqlCommand cmd…
c#answered Maycon F. Castro 1,025 -
0
votes1
answer46
viewsA: Error Installing lib React-navigation-tabs and React-navigation-drawler
Friend runs these two commands: yarn add react-navigation-tabs react-native link react-navigation-tabs I hope I helped friend
react-nativeanswered Maycon F. Castro 1,025 -
0
votes2
answers2220
viewsA: Map a json to React
You can access the value of your object by its keys: fetchSearchTopStories(searchTerm) { fetch(`https://viacep.com.br/ws/${searchTerm}/json/`) //irá printar o valor do seu cep no console…
reactanswered Maycon F. Castro 1,025 -
2
votes2
answers61
viewsA: "You have an error in your SQL syntax" with array
A single quotation mark is missing in your $promptname variable of your sql: $sql .="(NULL,'$codigo','$nome_pedido','$pedido')"; I hope I’ve helped.
-
0
votes1
answer48
viewsA: Import this into map/index.js
You can pass this value as property to your Details component: <Details distance={this.state.distance} /> And in your component Tails use it that way: this.props.distance So you will have the…
-
1
votes1
answer28
viewsA: Storing data from a constant as props
You pass it as a property of your component: <SeuComponente lista={lista} /> There in the component "Your component" you will be able to call it via props: this.props.lista And then it will…
-
1
votes1
answer17
viewsA: How to consume a constant in another JSX component
You need to do a destructuring: import { dados } from './dados.jsx' And if you want to use this syntax: <h1>{dados.nome}</h1> <h2>{dados.idade}</h2>…
-
0
votes1
answer42
viewsA: How to add class ="active"
The problem is that you are returning an object to the attribute 'classname' of your element, the correct would be to return only the string 'active': const isActive= (history, path) => { if…
reactanswered Maycon F. Castro 1,025 -
0
votes1
answer106
viewsA: How to Add an IF (Condition) to onEndReached in React-Native?
You can use the if ternary in this case: onEndReached={this.makeRemoteRequest == condição ? Se sim : Se não} I hope I helped friend.
react-nativeanswered Maycon F. Castro 1,025 -
0
votes1
answer441
viewsA: Save API request response as JSON file
You can use this function by only changing its url: (function (fetch, console) { fetch('https://urldaapi') .then(res => res.json()) .then(data => console.save(data)); console.save = function…
-
0
votes1
answer128
viewsA: Configuration of CORS tag in WEB.CONFIG in . NET project
The keying of your Web.config is wrong, you should put so: <system.webServer> <httpProtocol> <customHeaders> <add name="Access-Control-Allow-Origin" value="*"/> <add…
-
4
votes2
answers163
viewsA: What do these question marks mean?
It means that if the value of this.parameters["Loading"] is null the return will be 1.
-
0
votes1
answer112
viewsA: Do you need to do a controller method to get a model list method?
Friend so you can use this data in your front-end needs to do the controller, because he is the one who will direct his methods. It would look something like this: public JsonResult…
-
0
votes2
answers165
viewsA: how to clear an attribute in html by javascript
Friend tries to reset the options of your select before the new fill: $("#button").change(function () { var valor = $("#button").val(); alert(valor); $.post("procura.php", { valor: valor }, function…
-
1
votes3
answers1479
viewsA: Show input value by clicking the button
Change your function to get the updated value: function Enviar() { $("#enviar").on('click', function() { alert($("#usuario").val()) }); } If you want it to continue on the page change the…
-
2
votes1
answer305
viewsA: Show and Hide field with Select
// CAMPOS DO FORMULÁRIO $(document).ready(function() { $('#CNPJ').closest('div').hide(); $('#RazaoSocial').closest('div').hide(); $('#NomeFantasia').closest('div').hide();…
-
1
votes1
answer61
viewsQ: Show all span content regardless of size
I have a little problem showing a text on my screen: I have a span tag with id="obsEmenda" that gets a scan from the server: <span…
-
0
votes1
answer572
viewsA: SSL certificate
Friend type like this in the terminal: git config --global http.sslVerify false I hope I’ve helped.
-
0
votes2
answers133
viewsA: How to group and filter fields with JS
Amigo uses the alasql link: http://alasql.org/ It will allow you to work as sql in your javascript array. I hope I helped friend.…
javascriptanswered Maycon F. Castro 1,025 -
2
votes2
answers62
viewsA: Greater amount of appearances of an element in an object array - Javascript
Good morning Gabriel tries like this: seuarraydenoticias.reduce(function (autores, autor) { if (autor.Autor in autores) { autores[autor.Autor]++; } else { autores[autor.Autor] = 1; } return autores;…
-
2
votes2
answers110
viewsA: Datagrid show foreign key value instead of ID
Friend in your sql string put : Select * from TB_LIBERACAO L join TB_CARRO C on C.idCarro = L.idCarro join TB_MOTORISTAS M on M.idMotorista = L.idMotorista and in your while populating Datasource…
c#answered Maycon F. Castro 1,025 -
2
votes1
answer41
viewsA: Help using setItem and getItem from localStorage
Try it this way: First you put your data in localStorage and name it: localStorage.setItem('Content', $('#resposta').html()); Then you take it from localStorage by the name you put:…
-
1
votes1
answer78
viewsA: How to remove an item dynamically from an object?
You can delete by key: delete x[actionID]
-
1
votes1
answer89
viewsA: Special Character appears in Lowercase - PHP
Tries echo "<td>".mb_strtoupper($linhas['DESCRICAO'], 'UTF-8')."</td>" I hope I’ve helped.
-
0
votes1
answer357
viewsA: How to delete a word from every project in Visual Code
Amigo type CTRL+F and click on this arrow marked in the photo, put your text in the top field and the bottom one puts an empty string in the ''. And then click on the second icon marked to replace…
visual-studio-codeanswered Maycon F. Castro 1,025 -
1
votes1
answer241
viewsA: call a page by passing parameters in the url
The problem is in the quotation marks of the url: https:111.111.111:8080/index.html?login=me&password=1234 I think it solves.
-
0
votes1
answer2291
viewsA: Javascript media calculation by HTML form
Try it this way: function calculoMedia() { var media; var n1 = parseInt(document.getElementById('n1').value); var n2 = parseInt(document.getElementById('n2').value); var n3 =…
-
0
votes1
answer1116
viewsQ: Connect Entityframeworkcore with Oracle database
Good morning guys, I’m starting my studies with Entityframeworkcore and I noticed that it only communicates well with Sqlserver, someone knows some plugin or something like that that make this…
-
1
votes2
answers59
viewsA: Problems with array type?
You can concatenate the quotes: SELECT CONCAT('''', colunaa, '''') from minhatabela I hope I’ve helped.
-
1
votes1
answer435
viewsA: how to subtract column date with system date?
You can use the sql server DATEDIFF function: SELECT DATEDIFF(day,startDate,endDate) AS 'Duration' FROM dbo.Duration; In this case he calculates the difference of days between two dates.…
-
0
votes1
answer114
viewsA: MYSQL - Latest results when grouped by a certain field
You can do it like this: SELECT idUsuario, MAX(data), status FROM STATUS WHERE status = 'a' GROUP BY idUsuario; I hope I’ve helped.
-
0
votes2
answers554
viewsA: Check if working time is in the chosen time range Jquery/ Javascript
Using this data you have placed you can check by the index of the arrays: function VerificaRange(range){ var horario_funcionamento = [08,13]; if (range[0] >= horario_funcionamento[0] &&…
-
1
votes1
answer326
viewsA: Listing users of a json api in an html table with javascript
Friend first you create the html corresponding to a list: <ul id="lista"></ul> After that inside the Success of your ajax make the loop in your array: seuArray.map((el) =>…
javascriptanswered Maycon F. Castro 1,025 -
0
votes1
answer129
viewsA: Get Hidden value . net core
You must pass the Hidden pro controller input value and then move to the query method: [HttpGet] public JsonResult GetAprovacaoEmendaById(tipododado valordoInput) { HorariosItens horarios =…
-
1
votes1
answer110
viewsA: query the bank with ajax in beforeSend
You’ll do more or less like this: // Create connection $conn = new mysqli($servername, $username, $password, $dbname); // Check connection if ($conn->connect_error) { die("Connection failed: " .…
-
0
votes4
answers704
viewsA: How to add a new style to an html element?
Friend adds an id attribute to your tag and gives it a name: <b id"teste"></b> After that you can change the style of your jquery button: $('#teste').on('click', () => {…
-
0
votes3
answers56
viewsA: Cut word with CSS
Friend you can use jquery’s text() function to take text and substr() to leave only the last two numbers: $('#valYearCD').text($('#valYearCD').text().substr($('#valYearCD').text().length - 2,…
-
2
votes3
answers203
viewsA: How to show a column, but if null show another sql
Friend you can use mysql CASE: SELECT nome, nome_resumido, CASE WHEN nome_resumido IS NULL OR nome_resumido = '' THEN nome ELSE nome_resumido END AS Nome FROM Users; I hope I helped friend.…
-
1
votes2
answers173
viewsA: Pointing directories in git
Friend is not quite as you think, first you will create a repository on Github and then clone on your machine. After that you will copy all your files that were in another folder into your…
-
1
votes1
answer191
viewsA: ASP . NET - Local file directory using Chrome
Friend due to security policy issues google Chrome does not show the file path, it always shows a "fakepath" in place of the machine’s local path, what you can do in c# is to submit the form that is…
-
2
votes2
answers116
viewsA: Hide Menu tab
If it is when it enters another page you can hide that Nav with jquery: $(document).ready(() => { $('#idNav').css('display', 'none'); })
-
0
votes1
answer172
viewsA: Recover item index in list to delete
You can do it like this: 1º -> Add another property to your "list" as the index name. 2º -> Creates a function that will call the remove action by passing the index: function Remove(indice){…
-
0
votes1
answer75
viewsA: send request at the first button click
Use with attribute on your button: <button onclick="someFunction()"></button> I hope I’ve helped.
-
0
votes1
answer683
viewsA: Remove an iframe element
Friend you can use the jquery remove: $("#idFrame").contents().find("#element").remove(); I hope I’ve helped.
-
0
votes2
answers722
viewsA: Calling c# method in javascript
Friend you can use ajax to get the data from the backend without having to refresh the page: $("#CopaList").change(function () { $.ajax({ type: "GET", url: "SuaPagina.aspx/PreencheCampo", data:…
-
0
votes1
answer134
viewsA: How to capture the value of a JSON key (from an AJAX) using Jquery?
In case your array has more than 1 element you will need to use the . map() function or even a for going through your array: res.map((i, j) => { console.log(res[j].Id_Marca)…
-
0
votes1
answer699
viewsA: Send Json from client application and receive on Server
Amigo creates a class with all the properties of his JSON and where he receives the request instead of receiving a Stringcontent type puts his created class.
-
0
votes2
answers311
viewsA: A jQuery Get() inside another jQuery get()
Friend uses ajax that gets simpler: $.ajax({ type: "GET", url: api.mercadolibre.com/users/" + minha_id +"/order_blacklist?access_token=" + access_token, success: (response) => { $.ajax({ type:…
-
0
votes2
answers2686
viewsA: Modify attribute href via jQuery
You can change with the jquery attr() function: $('#elemento').attr('href', 'link que será passado') $('#elemento').attr('src', 'source da imagem') I hope I’ve helped.…
jqueryanswered Maycon F. Castro 1,025