Posts by Rafael Augusto • 4,027 points
242 posts
-
0
votes1
answer132
viewsA: In my photo gallery, I can’t open the images with Ligthbox separately, how do I?
I made this example of how to do what you want, it’s also in my github $(function(){ var modal = '<div class="shadow">'+ '<a href="#" class="close-box">X</a>'+ '<div…
-
2
votes3
answers1528
viewsA: Format search field with CSS button
You can do it like this... .in{ float: left; } .in input{ height: 35px; width: 250px; border-radius: 5px 0 0 5px; border: 1px solid black; } .b{ float: left; } .b button{ height: 39px; border: 1px…
-
1
votes2
answers100
viewsA: Why are you returning Nan?
You were just wrong when it came to declaring Math.ramdom(). Don’t worry, we all went through it when we were studying, it’s wrong you learn ;) var mostraBR = function(frase){ document.write(frase +…
javascriptanswered Rafael Augusto 4,027 -
0
votes2
answers2026
viewsA: View database data from
What is right is you provide a code to help us help you. But follow an example basico how to do. <?php try { $pdo = new PDO('mysql:host=localhost;dbname= dados', 'root', '');…
-
1
votes1
answer138
viewsA: Image Upload Does Not Work
There is a difference, first we need to understand what you are working with, but following. You might as well have one <input type="file"> to upload the photo, but I recommend using Plugin of…
-
1
votes2
answers145
viewsA: CSS and Jscript - Resize onClick image
function clickImagem(src) { $('#conteudo').empty(); var el = document.getElementById('conteudo'); $(el).html('<img…
-
0
votes1
answer867
viewsA: Base64 Multer Nodejs
After a while, I managed to solve my problem, I leave here the solution for case, someone goes through the same problem. router.post('/avatar', upload.single('avatar'), (req, res, next) => { let…
-
1
votes1
answer4563
viewsA: Javascript Category Filter
This is much simpler and has various ways of doing, a simple way and so on... $('.btn').on('click', function(){ var categoria = $(this).attr('data-categoria') $('.items li').each(function(){…
-
1
votes3
answers330
viewsA: Array Pose in Swift
You can do it this way... let arr:Array = ["Banana","Maça","Laranja"] find(arr, "Laranja")! // 2
-
1
votes1
answer504
viewsA: Insert a Div from another page
Try it that way.. $.ajax({ url: 'http://pipocaplayfm.com/artist/5216/Calvin+Harris', success: function(res){ $(res.responseText).find('.similar-artists')each(function(){…
-
3
votes1
answer605
viewsA: Create modal window
A simple example Alert.alert( 'Alert Title', 'My Alert Msg', [ {text: 'Ask me later', onPress: () => console.log('Ask me later pressed')}, {text: 'Cancel', onPress: () => console.log('Cancel…
react-nativeanswered Rafael Augusto 4,027 -
1
votes1
answer210
viewsA: Reading in JSON file generating error
The Problem is CORS, when testing the code below, I received the following error. Failed to load…
-
3
votes3
answers1359
viewsA: How do I run the script after loading the page
Framework7 itself has a way to perform functions every time you access a page. app.onPageInit('pagina', function (page) { // Sua função... }) the app is the assignment of framework7, are generally…
-
1
votes1
answer354
viewsA: Vuejs Menu Collapse
Man, if I understood what you want to do, one solution would be this... Hello. <template> <div class="hello"> <Menu :prop="{collapse: 'segundo'}" /> </div> </template>…
-
3
votes3
answers64
viewsA: Making a div reappear
$('#btn').on('click', function(){ $('#conteudo img').hide() }) $('#back').on('click', function(){ $('#conteudo img').show() }) #conteudo{ width:300px; height:300px; float:left;…
-
-1
votes3
answers1863
viewsA: Get original image dimension with Javascript
You can do it like this... let imagem = document.getElementById('imagem') let width = imagem.clientWidth; let height = imagem.clientHeight; alert(width + ' - ' + height) <img…
-
2
votes1
answer132
viewsA: Share iOS texts
An example of how to do this with Swift 3 import UIKit class ViewController: UIViewController { // share text @IBAction func shareTextButton(_ sender: UIButton) { // text to share let text = "This…
-
2
votes3
answers422
viewsA: Clone <select> jquery / javascript
Would that be it? the lack of jQuery? If it’s not, I don’t understand what your problem is. $(function() { var divContent = $('#materialInst'); var botaoAdicionar = $('a[data-id="1"]'); var i = 1;…
-
1
votes2
answers815
viewsA: Vuejs Router-View and Axios
You don’t need to reload the view, just have a method and call it whenever you click, or even reload it in x minutes. Ex: <script> export default{ data(){ return{ dados: [] } }, methods: {…
-
4
votes2
answers70
viewsA: HTML within d HTML
Header.php <nav id="menu"> <ul> <yp><?php echo '<p>'.$logado.'</p>'; ?></yp> <li><a href="/projetos/index.php">Home</a></li>…
-
1
votes1
answer67
viewsA: Node Create an API to validate Azure AD login
First you must start your project, to help you with these route questions, you can use the Express Generator, then you can use the Passport-Azure A Simple Example... app.get('/login',…
-
0
votes2
answers613
viewsA: Problems loading a list of Json in Vue.js
You’re using it wrong, you’re retrieving the answer like this ... response.data, when it’s actually response.body Just change that line self.bancodedados = response.response.body; Jsbin…
vue.jsanswered Rafael Augusto 4,027 -
2
votes5
answers1319
viewsA: Insert "X" value after some characters
var qtd = 10 var qtdX = 0 var div = document.getElementById('t') div.onkeyup = function(){ var valor = div.value if(valor.length == qtd + qtdX){ qtd = qtd + 10 qtdX = qtdX + 1 div.value = valor +…
-
1
votes3
answers385
viewsA: Center a circular div within another div
You can do it like this... .conteudo-externo{ width:200px; height:200px; z-index:3; background:#ff1; float:left; } .conteudo{ width:100px; height:100px; border-radius:50%; border:3px solid #000;…
-
0
votes3
answers604
viewsA: Dynamically Place Plot Value
$('button').click(function(){ var valor = parseFloat($('#total').val()) var parcela = parseInt($('#parcela').val()) var total = valor / parcela $('#valorParcela').text(total) }) <input…
-
0
votes4
answers627
viewsA: .append() an img tag?
I think what Voce wants is this. Or at least that’s what I understood, correct me if I’m wrong. $('button').on('click', function(){ var imagem = $('#imag').val(); $('body').text('<img…
-
1
votes2
answers2024
viewsA: How to take data from a form from another page
You need to use a BackEnd for this. I will give an example to be clearer. EXEMPLO1 - PHP <form id="form" method="POST" action="URL.PHP"> <input type="text" name="email"> <input…
-
0
votes1
answer611
viewsA: Take input values inside datatable
Here is an example of how you could do, checking and storing only the fields that have information. document.getElementById('enviar').onclick = function(){ let elemento =…
-
2
votes3
answers33037
viewsA: How to use the Icon tag in HTML?
Follow the example: <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> <button> <i class="fa fa-chevron-down"…
-
1
votes1
answer867
viewsQ: Base64 Multer Nodejs
I used the multer in my API, I uploaded the image, all right, but I would like to use Base64, here comes the doubt (I do not know much about base64), what’s the best way to do it? I made one in a…
-
2
votes1
answer198
viewsA: Crop image with PHP without libraries
A basic example. <?php $im = imagecreatefrompng('example.png'); $size = min(imagesx($im), imagesy($im)); $im2 = imagecrop($im, ['x' => 0, 'y' => 0, 'width' => $size, 'height' =>…
phpanswered Rafael Augusto 4,027 -
1
votes1
answer252
viewsQ: Import HTML Nodemailer
I’m using the nodemailer for sending emails on my server HTML in a variable, I wonder if it is possible to leave saved in a arquivo.html and just call his content to send that email. I’m currently…
-
1
votes1
answer282
viewsA: Change the anchor position of the top css selector?
Is that it? I didn’t understand much of your doubt. How is it only with the width of 42%, the line does not go to the end, but I think your idea should be the same. $(window).load(function(){…
-
0
votes1
answer29
viewsA: Send data together with form
$('button').on('click', function(){ $('#id').val($(this).attr('data-id')) }) <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <form>…
htmlanswered Rafael Augusto 4,027 -
0
votes2
answers403
viewsA: Problems with javascript and google maps API
<html> <head> <title>TODO supply a title</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head>…
-
1
votes2
answers276
viewsA: PHP mkdir folders with the same name
You can check if the directory already exists, if it exists, I put an additional one in the new name. if(file_exists($vregistro)){ // Aqui voce cria pasta com o nome atual e algo a mais }else{ //…
phpanswered Rafael Augusto 4,027 -
4
votes2
answers422
viewsQ: Calculating average time
In my bank I have a table that has the fields entrada, saida, the two fields have the format D-MM-YYYY H:M:S, would like to make an average calculation. Ex: The average waiting time is 30 min Based…
-
2
votes1
answer148
viewsQ: How to use foreign key to create a record in another table
I have two tables users and users_info, would like to use foreign key, for when I create a record in the table users, create a record with the empty fields in the table users_info, only with the…
-
-1
votes1
answer765
viewsQ: Update in two MYSQL tables
How to update two tables, e.g.: first table users, would update only on senha, but on the table users_info would update cos fields, cidade, nascimento, sexo and etc. I can do it in one, but I wanted…
-
1
votes3
answers230
viewsA: Changing button span through jQuery
$('span').on('click', function(){ if($(this).attr('data-value') == 1){ $(this).attr('data-value', 2) $(this).text('Remover') }else{ $(this).attr('data-value', 1) $(this).text('Comprar') } })…
-
5
votes3
answers1301
viewsA: Why are you concatenating instead of adding?
var cFinal = 0; var cFabrica = prompt("Insira o valor de fabrica do veículo"); var comissao = 0.28 * cFabrica; var imposto = 0.45 * cFabrica; cFinal = parseFloat(cFabrica) + comissao + imposto;…
javascriptanswered Rafael Augusto 4,027 -
1
votes1
answer1507
viewsA: Using jsPDF, are there any templates ready?
As far as I know, there are no proto templates, because it is not complicated to create, da para criar PDF a partir de um HTML (the resolution in general gets bad). In case of tables, Voce can use…
-
2
votes1
answer346
viewsA: Register an array in the mysql database
Da yes, first Voce needs to use html like this <input type="text" name="nome[]" size="30" required/> Then Voce can use one for or foreach to browse the array for($i = 0; $i <…
-
2
votes1
answer402
viewsQ: Query in multiple Node + Mysql tables
Taking into account the need to bring the result of a second table, based on the result of the first, how would you do this with Nodejs ? In PHP I would bring the result, and inside a while did…
-
2
votes1
answer218
viewsQ: Basic Nodejs Authentication
I’m starting now with Nodejs (I came from PHP), and I’m creating an API for an app of mine, I wonder, how do I make the queries based on Auth Basic, I don’t know very well how it works (I’ve already…
-
2
votes1
answer889
viewsA: How to dropdown to import database options
Making select is basically simple. Here’s a basic example <select> <?php $sql = $pdo->prepare("SELECT * FROM tabela"); $sql->execute(); while($ln = $sql->fetchObject()){ echo…
-
1
votes2
answers137
viewsA: Image on a text
I don’t quite understand what you want, but that would be it? $('.mouse').mouseover(function(){ $('.mostrar').show() }) $('.mouse').mouseout(function(){ $('.mostrar').hide() }) .mostrar{ display:…
-
2
votes1
answer183
viewsQ: Pure Javascript Portfolio Filter
I am trying to leave jQuery, however, I found a difficulty now, make a Filter, style those who is in Portfolio, but with JS Puro, only found in jQuery or CSS3 (on the internet), nothing with JS…
javascriptasked Rafael Augusto 4,027 -
2
votes1
answer460
viewsQ: Open Modal Vuetify
I’m having difficulty opening a Modal with Vue, I’m using Vuetify, I can open, as they show in the documentation, but I can’t open, just by clicking on a button (for example). <v-dialog…
-
0
votes0
answers39
viewsQ: Is it possible to use Babel via CDN?
I’m doing a project (App on JS + Cordova), and I came across a problem using let, const, arrow function and etc (Only works in more modern devices, such as, Android 6+ or IOS 10+). So I was…