Posts by Rafael Augusto • 4,027 points
242 posts
-
1
votes3
answers2552
viewsA: How to clear input fields after Ubmit?
I saw you put in tags jQuery, then you can use it, so you will not have problems, a simple use example is. // PHP $retorno = array(); $sql = $pdo->prepare("SELECT * FROM users WHERE id = ?");…
-
1
votes4
answers687
viewsA: Add all values that are in the database and show on screen
I don’t know if you know how to return the values, but based on my comment above, follow the base code. $sql = $pdo->prepare("SELECT SUM(valor) FROM anuncios"); $sql->execute(); $ln =…
-
0
votes4
answers562
viewsA: Display the output of a JS variable through Jquery in an html input
That would be more or less what you want? $('#seu').on('blur', function(){ var valor = $(this).val() var valorMaquina = "Tesoura" $('#maquina').val(valorMaquina) var resultado = '' if(valor ==…
jqueryanswered Rafael Augusto 4,027 -
0
votes2
answers1533
viewsA: HTML image size in a table
You can do so using CSS img{ width: 50px; } <table> <thead> <tr> <th>Imagem</th> </tr> </thead> <tbody> <tr> <td> <a…
htmlanswered Rafael Augusto 4,027 -
2
votes1
answer652
viewsA: Take data-value that is generated dynamically
That’s pretty simple, you use the document to refer since the DOM has already been loaded. $('#gerar').on('click', function(){ $('body').append('<button class="classeQueTereiEmTodos"…
-
3
votes1
answer1730
viewsA: Http Get Request with Axios
That’s simple, just declare it so <script> export default{ data(){ return{ checkbox: [] } }, methods: { api(){ axios.get('http://localhost:6000/API/Lojas', { params: { deletado: this.checkbox…
-
0
votes1
answer86
viewsA: Driving Route Here Maps
In the end, I managed to solve my problem, for those who have the same problem, follow the code. function calculateRouteFromAtoB (platform) { let router = platform.getRoutingService(),…
-
1
votes4
answers707
viewsA: Function . click does not work on buttons that were dynamically generated by the . html function?
No, the DOM has already been rendered, but you can resolve by referencing the document $(document).on('click', '#gerar', function(){ $('body').append('<button id="gerado">Executar…
-
0
votes1
answer86
viewsQ: Driving Route Here Maps
I’m trying to make a route between two points using HereMaps, until then all right, I got it, however, it does not go through the street, but through the whole map. How I would make him go down the…
-
1
votes1
answer1663
viewsA: Get coordinates, measure distances and compare them
I made a logic so you can calculate the distance, and that way you can know which one is closer and even catch the latitude and longitude this to show on the map. let atual = [-23.573037,…
-
1
votes1
answer55
viewsA: Create a temporary select file to repeat on other pages
Following a basic logic, we do the SQL and return a json // PHP $retorno = array(); $sql = $pdo->prepare("SELECT * FROM tabela"); $sql->execute(); $retorno['dados'] = $sql->fetchAll();…
-
2
votes1
answer312
viewsA: Ordered dynamic list with search data
If I understand correctly, you want to go searching and keep the previous Pills, you can do it using javascript. Let’s consider that I’m using the jquery // Estrutura HTML <ul…
-
1
votes2
answers1228
viewsA: htaccess rule for adding https
You can do it like this. RewriteEngine On RewriteCond %{HTTP_HOST} ^suaurl\.com.br [NC] RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}
htaccessanswered Rafael Augusto 4,027 -
3
votes2
answers483
viewsA: Problem saving information to localstorage via js
You’re doing it wrong. In this if if(access == '') { var d = new Date(); console.log(d); var time = localStorage.setItem('firstAccess', JSON.stringify(d)); setTimer(time); } switch to that…
-
-1
votes4
answers1576
viewsA: POST API Rest JSON
You’ll have to use javascript for that reason. Follow an example document.getElementById('submit').onclick = function(){ let jsonArr = { "nome": document.getElementById('nome').value, "senha":…
-
1
votes1
answer65
viewsA: Which Correct Way to Apply Lightbox to Each Descriptive Link and Clear
There are several ways to do this, a basic example to make your code cleaner is let classe = document.getElementsByClassName('link') let escurecer = document.getElementById('escurecer')…
-
0
votes1
answer78
viewsA: Text string word filtering
There are some ways to do this, a basic way would be. $('textarea').keyup(function(){ var texto = $(this).val() var email = /^[a-zA-Z0-9][a-zA-Z0-9\._-]+@([a-zA-Z0-9\._-]+\.)[a-zA-Z-0-9]{2,3}/ var…
-
1
votes2
answers451
viewsA: Get which div was clicked correctly
Basically you’re in the way, the point is that you’re trying to simulate again the click in the same div previously clicked. $(document).on('click', '.filter__filters', function(){…
-
1
votes1
answer127
viewsA: Contact Form 2017
You will always need a back-end that will do the sending of email, this is indispensable (but using Nodejs, you do the sending, which turns only JS). An example of this using JS + NodejS <input…
-
5
votes3
answers266
viewsA: Send what is being typed from one input to another in real time
Speaking in a simple way to understand, you can do so. function trim(str) { return str.replace(/[^a-zA-Z0-9]/g, '' ) } let input = document.getElementById('um') let input2 =…
-
2
votes1
answer1071
viewsA: How to save data from an HTML page to a file through Javascript?
If it is in PDF, you can use the Jspdf with the Html2canvas, a simple example of its use. <div id="div">CONTEUDO</div> <button id="download">GERAR PDF</button> let html =…
-
0
votes3
answers547
viewsA: Display value of an Indice array in an Alert
What you’re trying to do is use the variable i to declare the Indian, however, is not within a for let arr = ["Carro", "Avião", "Moto"] // Aqui você faz passando o indice manualmente alert(arr[0])…
javascriptanswered Rafael Augusto 4,027 -
2
votes1
answer627
viewsQ: Pass value to component with Vuejs
I have the following structure in my project 1. App.vue (Arquivo principal) 2. App.vue (outro arquivo que fica dentro da pasta paginas) 3. Dashboard.vue (filho do 2 app.vue) Within my second app.See…
-
0
votes1
answer847
viewsA: Bring images with ajax
Following the same idea you did with the description. Let’s assume your bank return is imagem, would do so... $.ajax({ type: 'post', url: 'SUA URL', success: function(data){…
-
1
votes2
answers84
viewsA: Anchor validation for download
If she’s going to register, it means you’re going to have a back-up involved, with that in mind, just send a flag return and check, Ex: document.getElementById('btn-ebook').onclick = function(){ //…
-
5
votes2
answers154
viewsA: What to do so that when the user hovers over an image, it expands a little? ( preferably using only HTML and CSS)
Follow the example img{ width: 100px; transition: 0.5s; } img:hover{ width: 150px; } <img src="https://file.iviewui.com/dist/76ecb6e76d2c438065f90cd7f8fa7371.png">…
-
0
votes2
answers2210
viewsA: How to open a page according to the link inserted in the input?
Follow an example document.getElementById('send').onclick = function(){ let url = document.getElementById("url").value alert(url) window.open(url, "_self") } <input type="text" id="url">…
-
1
votes3
answers41
viewsA: Jquery does not run correctly
$(function () { $('.abriracessibilidade, .via-close').on('click', function () { $('.menuacessibilidade').toggleClass('open'); }); }); .menuacessibilidade { position: fixed; top: 3em; left: 0; width:…
-
2
votes1
answer255
viewsQ: Hide component outside the router-Viewer
I’m using the Vue Rotuer to control the routes of my project, with this, I saw the need to use Navigation Guards. <script> export default{ beforeRouteEnter(to, from, next){…
-
0
votes2
answers48
viewsA: Pass value from one page to another’s input
You can use sessionStorage, this way the browser will save a sessão with your data and you can recover on any page. Page 1 <input type="text" id="email"> <script> let valor =…
-
0
votes1
answer65
viewsA: JS framework for image editing
There are many ways to do this, and you probably won’t find one that does everything you want, the way you want it, what you can do, is take one that does little and improve/adjust to your need. One…
-
0
votes1
answer648
viewsA: Restrict access to routes if you are not logged in to Vuejs
For those who even with the documentation had the same difficulty than I to implement, follows the code and a brief explanation. In my main.js i defined globally router.beforeEach((to, from, next)…
-
4
votes2
answers50
viewsA: How to change the layout of a page without touching the source code?
There are many ways to do this, the most correct would be to store the user’s choice in the database, so whenever the user updates himself, he would have the page the way he chose (with the button…
-
3
votes2
answers220
viewsA: Hide/Show in Ivs according to subclasses
Could do so.. $('nav ul li').on('click', function(){ var div = $(this).attr('data-div') $('.blc-ca div').addClass('hidden') $('.'+div).removeClass('hidden') }) .hidden{ display: none } <!DOCTYPE…
-
2
votes2
answers3068
viewsA: Convert image to Base64 using Vuejs?
You can do it like this... <script> let image = '' export default{ created(){ this.getDataUri('urlDaImagem', (dataUri) => { image = dataUri }) }, methods: { getDataUri(url, callback){ let…
-
2
votes0
answers182
viewsQ: Tinymce with Vuejs
I’m trying to use the Tinymce with Vue, but so far unsuccessful, I have used several and none of them worked. <template> <div> <Button type="primary" @click="newPost =…
-
1
votes1
answer63
viewsA: APK protection against Disassembly and others
All the rough is on the back, the cool is to use Token to validate back-end sessions to protect yourself. As I said, the important thing is to treat the back end well to avoid serious future…
androidanswered Rafael Augusto 4,027 -
5
votes1
answer648
viewsQ: Restrict access to routes if you are not logged in to Vuejs
I’m developing a Dashboard and I doubted how to forbid access to rotas if they are not logados, with this, I thought of some solutions that would use localStorage, but none is a sure solution. What…
-
0
votes2
answers105
viewsA: Dynamic height in 'product cart'
I don’t quite understand what you mean, but I think that’s what you want. var subtotal = $('.subtotal').height(); $('.subtotal-menu').click(function(event) {…
-
0
votes1
answer170
viewsA: Share document (PDF, JPG, etc.)
I solved my problem using the plugin Socialsharing var options = { files: ['arquivo.png'], chooserTitle: 'APP' } var onSuccess = function(result) { console.log("Share completed? " +…
-
2
votes1
answer1824
viewsA: Vuejs Graphics Creation Library?
You can use the Vue-Chartjs, is very simple to use, besides being one of the most beautiful. import VueCharts from 'vue-chartjs' import { Bar } from 'vue-chartjs' export default Bar.extend({ mounted…
-
1
votes2
answers128
viewsA: Save filename in BD and access them later?
To save to the bank, Voce needs to register the file name, Ex: <div> <div style="padding-top: 300px;"> <center><form method="post" enctype="multipart/form-data" action="">…
-
0
votes2
answers117
viewsQ: Whether or not to use Mainstoryboard Swift
I started my studies in Swift, currently I am studying Swift 4, but I have come across a question, which I believe many people who are starting have (or not). In the course I see, the teacher…
-
3
votes1
answer2416
viewsA: Add a scroll bar to a DIV
.menu{ width: 300px; height: 100px; overflow-y: scroll; } <div class="menu"> Lorem Ipsum é simplesmente uma simulação de texto da indústria tipográfica e de impressos, e vem sendo utilizado…
htmlanswered Rafael Augusto 4,027 -
0
votes3
answers3219
viewsA: How to align image next to image
.ads01{ float: left; width: 50px; } img{ width: 100%; } <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width">…
-
1
votes2
answers927
viewsA: Format CSS table color
table thead{ background: #2980b9; color: #FFF; } table tbody{ background: #3498db; color: #FFF; } table thead tr td{ padding: 5px; text-align: center; } table tbody tr td{ padding: 5px; }…
-
1
votes1
answer60
viewsA: Error of a Vue project with Laravel
As I said in reply, for you to solve your mistakes, start by taking out all the ; which it owns. Ex: import Vue from 'vue' import app from './app' require('./bootstrap') new Vue(app).$mount('#app')…
vue.jsanswered Rafael Augusto 4,027 -
2
votes1
answer24
viewsA: Make several div’s Fixed
You say so? $(document).ready(function(){ $("button").click(function(){ var tamanho = $(this).parent().height(); $(this).parent().css('height', tamanho+'px') //alert(tamanho) if($("#p" +…
-
0
votes2
answers446
viewsA: Accents problem in Vue-json-excel
After a lot of work (not so much) I discovered the mistake and will leave here for those who go through the same as me. The modulo owns the :meta to receive the parameters, however, when you install…
-
1
votes2
answers446
viewsQ: Accents problem in Vue-json-excel
I’m using the vue-json-excel to export an Excel spreadsheet (I have the table on my screen and use it to export the same data to excel). Until then, everything works perfectly, however, I had…