Posts by César Felipe • 467 points
25 posts
-
0
votes1
answer343
viewsA: Paging with Nodejs and Mongodb
The solution to this problem is to pass another query param to your route, indicating the amount of items that should be "skipped". What is happening today is that you are always "skipping" 10…
-
0
votes2
answers109
viewsA: How to return to the previous state? (Vuex)
I believe that the best solution would be to create another state (Array[]) to store the changes in the user. And in CHANGE_USER Mutation, you would . push in this state with the current user state,…
-
1
votes1
answer546
viewsA: How to get the return data from the api with Vue.js
Both Vue and API codes are correct, the problem that is when you connect the two, the name of this is CORS. For security reasons, it is not possible to request a domain from one domain to another…
vue.jsanswered César Felipe 467 -
1
votes1
answer30
viewsA: How to make a dynamic method?
You can create only one method that uses interpolation. Follow the example: public function loadBy($key, $withValue) { $bind = ":{$key}"; $sql = new Sql(); $results = $sql->select("SELECT * FROM…
phpanswered César Felipe 467 -
1
votes2
answers152
viewsA: How to put id value contained in input elsewhere on the javascript page?
You can use the querySelector function to locate the elements in the DOM and the innerText/innerHTML function to update the contents of an element. From what I understand, your problem would be…
-
4
votes1
answer1454
viewsA: How to put javascript variable value in CSS?
You can use the CSS variables themselves and update via Javascript. Ex.: Defining the variable via CSS. :root{ --tempo-animacao: 1s; } div.progresso { animation: loading var(--tempo-animacao) ease;…
-
0
votes3
answers57
viewsA: I cannot return data from an asynchronous Ajax
the problem is happening because you are initiating 'Dditems' and assigning a value only in the return of AJAX, but your function is returning before AJAX has been completed. There are two ways (I…
-
0
votes1
answer379
viewsA: Save contents of a Textarea to a file . txt and display them again when updating the page
a solution to your problem is using the localStorage the javascript itself and also use the firestorage google. I made a small example without much deepening in that link. Below is the code used.…
-
2
votes2
answers48
viewsA: Method opens all modals of the v-for elements
One solution is to create a field within the object to control whether the modal is open or not. new Vue({ el: "#app", data: () => ({ modalOpen: false, listaProjetosModelos: [{ departamento:…
-
2
votes1
answer828
viewsA: Folder Listing in Node.js
You need to sort the array before making the iterations, I made a small example below what you need. const testFolder = './dir' const fs = require('fs'); function readDir(dir){ let struct = {} fs…
-
0
votes2
answers164
viewsA: How to conditional disable a link with bind href in Vue.js?
You can use a dynamic v-bind, I did that example. <div id="app"> <a v-for="item in itens" v-text="item.nome"v-bind="formatBind(item.level)"></a> </div> new Vue({ el: '#app',…
-
1
votes1
answer136
viewsA: How to perform a "back" Transition using Vue Router?
Has that example in the repository itself that how is it possible to do this. You need to pass the animation dynamically through a property. To define which animation to use and when to use it you…
-
0
votes2
answers529
viewsA: Compare objects with object array
I did this example on codepen what the code would look like. But what you’d need to do is just that: b.filter( item => JSON.stringify(item) !== JSON.stringify(a) )…
javascriptanswered César Felipe 467 -
0
votes2
answers45
viewsA: Is there any way to pass the value of a $_SESSION to a link?
You can use the header(), it would look like this: header("Location: url_de_redirecionamento?id=$_SESSION['id']")
-
0
votes2
answers379
viewsA: Check Javascript element property change
Fez this example and I believe it’s already the solution to your problem
-
2
votes0
answers79
viewsQ: Difference between@ and . / in the import function
I would like to know the difference between the codes below: import module from '@module' import module from 'module' I recently had a problem where I had to stop using import firebase from…
-
2
votes1
answer168
viewsQ: Production vs Development - WEBPACK
I would like to know the difference between the modes of "Development" and "Production" within Webpack4.
-
2
votes1
answer801
viewsA: Push notification with Socket.io
I think a solution to your problem would be this var socket = io('http://localhost:4555', {transports: ['websocket', 'polling', 'flashsocket']}); socket.on('notificacao', function (data) {…
-
1
votes2
answers199
viewsA: Capture URL that is inside a div with Jquery
From what I understand you need the following code: $('.single-project').on('click', function() { window.location.href = $(this).find("a").attr("href"); }); If you have multiple Urls…
-
0
votes0
answers21
viewsQ: Usage of ... in Arrays (Javascript)
I wonder what the "..." is for before a Javascript array. Thanks in advance
javascriptasked César Felipe 467 -
0
votes1
answer32
viewsQ: Multiple Prototypes
I would like to know how to add a prototype to a function that is already instantiated in a prototype. Example below: app js. 'use strict'; function NivFire(){ this.db = "", this.admin = "",…
-
1
votes1
answer804
viewsA: POST de imagem, via ajax
2 things to do 1º Add enctype in form <form enctype="multipart/form-data" id="form" action="enviarPost" method="post"> </form> 2º Add attributes in ajax $.ajax({ url: "urldesejada.php",…
-
0
votes0
answers979
viewsQ: Problem while booting mongodb on Windows
The mongodb stopped working on my computer overnight, when I type "mongod" in the cmd appears the following log: 2018-02-14T12:23:31.189-0700 I CONTROL [initandlisten] MongoDB starting : pid=31268…
mongodbasked César Felipe 467 -
2
votes2
answers1314
viewsA: Redirect an address with javascript
jQuery $(document).ready(function(){ window.location.href ="url y"; }); Javascript <body onload="window.location.href = 'url y';">…
-
2
votes1
answer134
viewsQ: Difference in Java casting
What is the difference between the 2 codes below? first int x = 10; float i = (float) x; 2nd int x = 10; float i = Float.parseFloat(x);…