Posts by Ivan Ferrer • 12,096 points
772 posts
-
2
votes1
answer65
viewsQ: How to extend a global method in tests using globalThis?
I’m making a node.js exercise, but the version I’m working on is younger, and has now adopted the globalThis in the instance global. import { SetupServer } from "./server"; import supertest from…
-
0
votes0
answers15
viewsQ: How to test an element using Compose?
const enhance = compose( mapStateToProps, withRouter, withApollo ) export default enhance(ManagePublicTable) In the archive Managepublictable.spec.js I’m importing the component as: import {…
-
0
votes0
answers14
viewsQ: What is the difference between withApollo and graphql?
In some React projects, I have two situations that seem to have similar purposes, but I don’t know exactly how each reacts to a graphQL call, a Mutation call, or a simple restful API call: Both are…
-
0
votes0
answers31
viewsQ: Align populated values by columns using case when in mysql
As I could align the values in this SQL query per column, are 2 possible questions for each question in a list of several users who answered the first and second question: question one? answer a…
-
0
votes2
answers36
viewsA: Show input field depending on radio button selection
Something simple to do this is using pure javascript even: window.onload = () => { var input = document.getElementById('descreva'); var radio_yes = document.getElementById('sim'); var radio_no =…
-
-3
votes2
answers68
viewsA: Javascript function equivalent to Delphi Frac
From what I understand you need something like this: var numberToFraction = function( amount ) { // This is a whole number and doesn't need modification. if ( parseFloat( amount ) === parseInt(…
-
0
votes1
answer23
viewsA: Problem accessing an attribute dynamically inserted into a Sequelize "ready" object
In case, you have an object called Fund, to set the value just do this: var fund = { ... } fund.dataValues.actualValue = value;
-
1
votes1
answer26
viewsA: Processing to save + signal in the BD through a registration form
To pass parameters via javascript you need to use: encodeURIComponent(str), see in case your example would be: SE6:…
-
-1
votes1
answer59
viewsQ: How to hide the input title when filled in the form using CSS
<div class="content"> <span class="title" for="input_example">Título do campo</span> <div class="form-content"> <input type="text" id="input_example"…
-
0
votes3
answers90
viewsA: How to put two functions in onclick for one to be done if the other works
If I understand correctly, you want to create a title that would be the action of the button and then run it: <button onclick="executeButton(this)">qual o nome do botão</button>…
javascriptanswered Ivan Ferrer 12,096 -
0
votes1
answer33
viewsA: I cannot validate input number separately
One way to do it would be like this: <input type="checkbox" name="acr[0]" data-id="1" data-valor="2.00" value="Queijo" /><label>Queijo - R$ 2,00</label> <input type="number"…
-
0
votes1
answer63
viewsA: How to pick variable from a file from another site by Curl
Thus, there are several ways to do this, this is one of them by Curl, however it would not be necessary to do Curl to subtract the parameter: <?php class Filter { public static function…
-
2
votes2
answers340
viewsA: How to place an image inside echo and not show if it is empty
Why you do not create a verification method if the image is valid: <?php function checkImage($img = null, $nome = null) { if ($img != null && $nome != null) { return true; } return false;…
-
0
votes3
answers346
viewsA: Redirect file access via htacess
What happens is that the rule you’re using is not redirecting, it’s rewriting the path, to redirect, you need to use the redirect rule, try doing it this way: RewriteRule ^(.+)\.txt…
-
1
votes2
answers581
viewsA: Return True or False $.ajax(). done
The method $.ajax({...}) is not returnable, because in addition to expecting a Promise, it is an encapsulated method, that is, there is no possibility of externalizing it, but vc can pass the data…
-
1
votes1
answer20
viewsQ: Passing attributes to viewport via CSS
What are the attribute models that we can pass to the viewport through CSS? Taking an example of the attribute content meta tag <viewport></viewport>: user-scalable=no, how I would…
-
0
votes1
answer26
viewsA: How to make a Rigger draggable?
I decided here, actually I did not need to think about the element through the dragabble event, but in the rendered element that uses draggable, every time I call the zoom tool, I reposition the…
-
1
votes1
answer26
viewsQ: How to make a Rigger draggable?
I’m having trouble positioning an element in the center when I click on a zoom method, an element UI Jquery Draggable is dragged off to the corner, and I click on a zoom tool, it ends up…
-
0
votes0
answers12
viewsQ: Does viewport influence the use of the css touch-action attribute?
I’d like to use the pincer css (touch-action) event in a container, but I don’t know exactly why it’s not working in my container: css: .container { position:relative; top:0; left:0; z-index: 15;…
-
0
votes5
answers120
viewsA: Merging an array with an object array
You can use the map array to map your object according to the model you want to display: let apis = [ {id: "1", name: "api 1"}, {id: "2", name: "api 2"}, {id: "3", name: "api 3"} ]; let applications…
-
1
votes0
answers34
viewsQ: How to perform zoom events by tweezing a "draggable" element?
I have an element that uses ui dragagble, which works when drag element, but I wish I could call the methods zoomIn() / zoomOut(), when you were on the phone, through that pincer event: Pinch Event.…
-
0
votes2
answers107
viewsA: How to save the Insert Radio Button with Bootstrap to the Mysql database
I believe your problem is because you need to put a value attribute with the value you want to insert from your input, example: <input class="form-check-input" type="radio" value="M"…
-
0
votes0
answers21
viewsQ: How to allow youtube video to be expanded on mobile MI 8 SE?
I have an app made in React-Note that there is a video embedded in a webview. A client complained that she can not expand the youtube video on the full screen of her mobile phone, I took the model…
-
1
votes2
answers289
viewsA: Redirect with . htaccess if url contains string
Nice that you solved, but there is another way that would put another . htaccess inside an "api/" folder, and point the route to it, example: Imagine you have a folder: /raiz/public/ Then you create…
-
0
votes2
answers48
viewsA: Save values from fields created With Append(dynamically created field ) in the database
So what you need to do is basically feed the empty array fields, no keys descricao[]: HTML: <div class="content"> <div> <button onclick="actions.removeField()"> - </button>…
-
0
votes1
answer27
viewsA: Manipulate the DOM and remove empty paragraph before and after a figure element?
It worked that way: function removeParagraphAfterAndBeforeFigure(result) { var el = document.createElement('div'); el.innerHTML = result; el.querySelectorAll('figure').forEach(function(value) {…
-
-1
votes1
answer27
viewsQ: Manipulate the DOM and remove empty paragraph before and after a figure element?
Using some Javascript method, how could you remove elements that are soiling HTML? I have the following HTML: <div class="container-text"> <p> Teste onon onon noonnoon </p>…
-
0
votes2
answers52
viewsA: How to remove a style font from a string using DOM manipulation?
Here’s the solution that worked: function removeFontSentinel(result) { var el = document.createElement('div'); el.innerHTML = result; el.querySelectorAll('style') .forEach(function(value) {…
-
0
votes0
answers70
viewsQ: How to implement a Swipe event for this carousel?
I’m using that lib: angular-ui-Carousel This plugin has a compiled template, so it does not allow you to use ng-if in the scope, use only ng-show / ng-Hide. It keeps as a rule the key "item" to pick…
-
0
votes2
answers52
viewsQ: How to remove a style font from a string using DOM manipulation?
I’m getting the following HTML from an API: <body> <div class="container"> <style> .g-aiPstyle0 { font-family: 'Sentinel SSm A', 'Sentinel SSm B', serif; font-size: 16px;…
-
1
votes2
answers71
viewsA: how to create numbers in different variables in JS javascript
I believe that’s what you wish to do: function generateOptions(param1, param2, qtde) { do { var multi = [], original_calc = 0, calc = 0; for (var i=0; i < qtde; i++) { var n1 =…
javascriptanswered Ivan Ferrer 12,096 -
1
votes2
answers123
viewsQ: Is it possible to delete the browser history?
Is there any way to delete all browser history via javascript? The browser is accumulating about 46 histories on my site, and I can’t reduce it even with angry prayer: I’ve tried with:…
-
0
votes0
answers23
viewsQ: Browsing history stuck in loop
I have two links, one is intro and the other reading: /system/intro/1373/ninth-ninth (Introduction booklet) /system/reading/1373/ninth-ninth-ninth (Reading booklet) Navigation would be in this…
-
-1
votes5
answers12763
viewsA: PHP - Transforming object into array
But in case, you don’t have a collection to go through, so you can’t go through it, to access the data after converting into array would just do this: echo $array["Clientedata"]["nome"] .…
-
0
votes3
answers239
viewsA: Ordering arrays with Bubble Sort
I believe that the fastest way is to travel until you reach the end of this ordination: let bubble = [82, 76, 6, 52, 45, 38, 24, 14, 54, 85, 143, 98, 65, 512, 96, 12, 4, 79]; function…
-
1
votes0
answers93
viewsQ: Problem with Xdebug in vsCode
Until yesterday it worked normal, now it is always returning this error in the middle of the process in the debug console: XDebugError: command is not available at new Response…
-
2
votes2
answers200
viewsQ: Identify if the mobile phone keyboard is open
I know it’s possible to identify when a person clicks on a particular element of the screen for the first time, but if that were to improve. How could I identify if the mobile phone keyboard is open…
-
0
votes2
answers65
viewsA: How to convert a separate string into comma and letter "and" at the end to an array from the existing numbers?
I think I found a solution: $scope.filterRecomendations = function(recomend) { var list = recomend.match(/\d+/g); list.sort(function(x,y){ return x - y; }); var collection = []; for (var i in list)…
-
0
votes2
answers65
viewsQ: How to convert a separate string into comma and letter "and" at the end to an array from the existing numbers?
How could I extract from a string like this: var texto = '4°, 5° e 6° ano'; A result like this: var array = [ 4, 5, 6 ]; Or even better this way: var array = [ '4° ano', '5° ano', '6° ano' ]; I…
-
-1
votes1
answer115
viewsQ: How to properly align an item gallery with flexbox?
I’m starting to use CSS flex, and I realized that when we centralize a container, it looks like the elements inside the container seem to be centralized, but if I align it to the right, the…
-
0
votes3
answers87
viewsA: Quantity return error in deleting the registration of a sale in PHP code
There’s n errors in your case, you are creating a false query, because you are not taking the value returned from a query, but its string: That: $quantidade_vendida = "SELECT quantidade FROM…
-
0
votes1
answer453
viewsQ: Is it possible to change the parent element’s css when there is a different child?
With CSS, is it possible to modify the parent CSS if the child has a different class without changing the parent class name? I just need to actually change the default bottom of the page, when the…
-
0
votes1
answer13
viewsA: How to make the menu not be hit by the iPhone scroller?
I think I found the solution: :root { --ion-safe-area-top: 20px; --ion-safe-area-bottom: 22px; } https://github.com/ionic-team/ionic-framework/issues/19060…
-
-3
votes1
answer13
viewsQ: How to make the menu not be hit by the iPhone scroller?
In the browser of Safari / or Chrome in the iPhone mobile version, appears a rolling bar on top of the menu, there is a way to resolve this when iPhone? SCSS: @mixin getSideRadius($side:'normal',…
-
0
votes2
answers130
viewsA: What is the best way to capture screen resizing in real time?
I think I might be able to solve this using CSS only: .state-indicator { display: none; } @media all and (max-width: 1200px) { [data-type="small-desktop"]{display: block} } /* tablet */ @media all…
-
0
votes2
answers130
viewsQ: What is the best way to capture screen resizing in real time?
There is a better way to get real-time resizing of the screen? I need to know if it’s mobile or desktop, as I resize the screen, because the way it is is not 100% effective... (I’ve tried with…
-
1
votes1
answer40
viewsQ: How to make an automatic grid for exact measurements using SCSS?
I have the following example but in percentage: $grid__cols: 12; @for $i from 1 through $grid__cols { .col-#{$i} { flex-basis: (100 / ($grid__cols / $i) ) * 1%; } } That may be tested here, to…
-
1
votes1
answer65
viewsQ: Is it possible to limit the number of items in a dynamic list using CSS only?
Let’s assume that I have a normal auto-complete dynamic list, which has 5 items in the desktop version, and when it is mobile, through media queries I would like it to appear only 3 items, but I…
-
0
votes1
answer48
viewsA: How to map Xdebug in Vscode to a vhost?
Solved the mapping: { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit:…
-
-3
votes1
answer48
viewsQ: How to map Xdebug in Vscode to a vhost?
I have a project that’s coming from the SD Card: /Volumes/SDCARD/sd_projects/sistema-news/sistema-news-web/ Xdebug works when I have a file at the root of the localhost directory:…