Posts by Brunno Vianna • 755 points
31 posts
-
0
votes1
answer684
viewsQ: I cannot navigate correctly using ion-tabs (IONIC 4)
I have the following code structure: app-routing.module.ts import { NgModule } from '@angular/core'; import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; const routes: Routes =…
-
0
votes0
answers190
viewsQ: How to format REST API display in browser using PHP
I am building a Rest API using PHP. The data are accented correctly from the database and arrive in the application also correct. The problem is trying to access the API address from the browser. I…
-
1
votes2
answers177
viewsA: How to add a column at page run time?
You need to create a function that adds a new line. First, put a class on the button, like this: <button type="button" class="addBtn">Adicionar mais uma linha</button> Afterward:…
-
0
votes0
answers97
viewsQ: Value-based dynamic interface of an object (Typescript)
I’m trying to accomplish the following: interface A { name: string, type: string } let var_A: Array<A> = [ {name: 'firstName', type: 'string'}, {name: 'lastName', type: 'string'}, {name:…
-
1
votes1
answer501
viewsQ: Mysql: Limit record recording based on value from another table
I have a table A with a field start_date and another end_date. I have a table B with a field date. Is there any way to ensure that a record is only saved on B when B.date be among A.start_date and…
-
1
votes2
answers138
viewsQ: Automatic cast with Typescript?
To the point: There is a way to cast automatically using an interface as a model in Ionic (Typescript + Angular 5)? If not, you can make Lint recognize that an object coming from the server is not…
-
4
votes2
answers256
viewsA: Function javascript duplicating trigger by init method
You need to remove the function that is in the click on .edit-collaborator: $(document).on('click', '.edit-collaborator', function (e) { e.preventDefault(); console.log('fui chamado') }); Should be:…
-
0
votes2
answers112
viewsA: Paging with twbsPagination plugin giving problem
This plugin does not serve to handle the data, just to facilitate the creation of a pagination. Who will segment the content is you. You can, for example, create a series of Divs with the contents…
-
3
votes1
answer2645
viewsA: Force a shortcut to open Firefox directly on a page
You can use both forms: 1) With short cut: When creating a shortcut, put Unidade:/caminho/para/firefox.exe "www.endereco.do.site" 2) With command line (possible to use in batch as well): Contain the…
-
0
votes1
answer417
viewsA: jQuery returning r.fn.init()] strange error
Errors are basically of inattention. Some problems in the code: You added # to the id in Chapter and Typoex. At the time of calling the object, it would obviously not locate. Still in Chapter, you…
jqueryanswered Brunno Vianna 755 -
1
votes1
answer46
viewsA: Display None in Chrome for iphone
Safari prevents form elements from being changed by css using display: None. Long story. The alternative would be to manipulate these options using js. There are numerous cases with this same…
-
1
votes2
answers884
viewsA: Popular inputs with Json file in jQuery
First, request the json file: $.ajax({ url: "nomeDoArquivo.json", success: function(data){ } }); Save the data somewhere else: var dados; $.ajax({ url: "nomeDoArquivo.json", success: function(data){…
-
1
votes1
answer50
viewsA: Javascript return function
You can’t do it that way. The database.transaction function is probably asynchronous and remote more than js runtime to answer. Do so: var pegaNomeMedico = { nome : function(callback){…
javascriptanswered Brunno Vianna 755 -
1
votes1
answer1316
viewsA: "Wildcard" character as a query criteria
The wildcard character exists and is the "%". It should be used in conjunction with the word LIKE in place of the sign of equality (=) (as pointed out in comment. That said, I think it would be bad…
-
1
votes1
answer24
viewsA: Field validation problem with ajax
Why not use a script already ready? So much simpler. It will do all the checking of when the field is or is not according to the rules. Index the https://jqueryvalidation.org/ Anyway, if you want to…
-
0
votes3
answers1333
viewsA: HTML link to open form without causing refresh on page
When you trigger an element, the browser assumes that you want to go to a new address. As you assigned "#" to the href of the element, it loads the page again by adding "#" to the end of the url.…
-
0
votes2
answers3283
viewsA: Pass whole javascript variable to php
PHP is a language server side. That means it runs on the server. Javascript is a language client side. That is: runs on the browser interface. That being said, it is important to reply that PHP,…
-
0
votes3
answers311
viewsA: How to simulate click on another HTML element?
It would be good to provide the structure of html so we can better understand how to do it. But if you are using the "default" structure for tags <img> and <figcaption> (that is, whereas…
-
0
votes4
answers380
viewsA: column-Count in css by breaking the line at the beginning of the column
If you use like this doesn’t solve your problem? .coluna br:nth-child(odd){ display: none; } You wouldn’t need to change the database or need that much code.…
-
2
votes2
answers2189
viewsA: How to know the user’s operating system version using Javascript?
It is possible and there are a dozen solutions to this on the internet. Look at two things: It will be difficult for you to enable options for any and all OS as there are numerous. New OS appear and…
-
0
votes1
answer49
viewsA: Create Delivery Time by ZIP Group
I suggest you use a different approach to your solution. We can use a map with all these ceps and the values you will need to extract. This will avoid excess of if in your code and facilitate future…
-
2
votes1
answer56
viewsA: Do not clear screen data when giving error
You are using window.location.reload() just to clear the form fields and this is not absolutely recommended. Let’s say your form is <form id="form">, then make a selector on the form…
-
0
votes2
answers956
viewsA: Hide a div containing photo and show another div in the same place
There is no problem inserting more than one click event into the same element. $("#startbutton").on("click", function(){ $("#photobd").hide(); $("#photo").show(); }); Simple as that. Another thing:…
-
1
votes1
answer261
viewsA: How to use Media Queries for responsive websites based on the dimensions of Vices?
If you want to serve ALL your code will turn into a madness and will be maintenance impossible, since every time a new device popcorn and that can have new dimensions. I recommend that you work with…
-
1
votes3
answers51
viewsA: Interpret data from an external file to use in Autocomplete
Compile all data coming from the database within an array and then return the array to your ajax using json_encode. if ($busca_descricao->num_rows() > 0){ $result = array(); while…
-
8
votes2
answers150
viewsA: Is it worth using the W3C validator?
Let’s go over the HTML5 specification on the type tags <h#>: These Elements have a rank Given by the number in their name. The h1 element is said to have the Highest rank, the h6 element has…
-
1
votes1
answer43
viewsA: Clear database column from time to time
If you already register this data, why delete it? You can do this using Rigger (you need to detail which bank you are using). But it’s server processing waste. If it’s just by displaying the data to…
databaseanswered Brunno Vianna 755 -
1
votes1
answer778
viewsA: How to check how many days passed from a Javascript date
Take a look in that Stack Overflow response But to make it easier: function dateDiferencaEmDias(a, b) { // Descartando timezone e horário de verão var utc1 = Date.UTC(a.getFullYear(), a.getMonth(),…
-
6
votes3
answers845
viewsA: How to simulate Ctrl+v
I’ll reply because I don’t have access to comments. Then I can edit this reply. Copying the contents of the clipboard is something very well protected by browsers for security reasons. Simulating…
javascriptanswered Brunno Vianna 755 -
3
votes1
answer62
viewsQ: Scope in asynchronous call (Javascript)
Suppose I had the following method: this.loadCustomers = function(){ Request.get("php/loadCustomersAction.php", (function(error, data){ if(!error) this.setCustomers(data); }).bind(this)); }; where…
-
3
votes2
answers30
viewsQ: Use of Class.apply in the context of a specialized class
I saw an example that dealt with Class father and Class daughter where, at the beginning of the specialized class, it was like this: var ClasseFilha = function ClasseFilha (){ ClassePai.apply(this,…