Posts by waghcwb • 1,915 points
53 posts
- 
		0 votes1 answer294 viewsA: Consult an API via POST - Vuejs - XiosYour code is apparently correct, you have tested the API service by Postman or similar? I made an example very similar to yours to exemplify and is working properly: api.js import axios from… 
- 
		3 votes1 answer303 viewsA: Vue.js: how to change a $state of Vuex that is in a v-model?You need to create a mutation in his store, one mutation is used to update a value in state: import Vue from "vue"; import Vuex from "vuex"; Vue.use(Vuex); const store = new Vuex.Store({ state: {… 
- 
		0 votes1 answer382 viewsA: How to save form data to a global obj using Vuex Vue.js with Laravel 5.8To achieve your goal you can use two Vuex helpers, the mapState and the mapMutations. Let’s take an example, the code below will create your store with a global form and Mutation to set the form:… 
- 
		0 votes1 answer219 viewsA: Fill modal with Vue jsBy default, the watch function observes modifications to an object at a "higher" level, i.e., it observes no internal modifications to the object. So if you have the object post and change it to… 
- 
		2 votes2 answers6612 viewsA: Problems using v-Mask (Vue.JS)Are you trying to use the directive of v-mask but is importing the plugin and not the directive. Here’s an example working: main.js import { VueMaskDirective } from "v-mask"; Vue.directive("mask",… 
- 
		2 votes2 answers929 viewsA: Change the color of only one button in VuejsThere are several ways to do this, let me give you an example with class and style interconnection. First we will need a date that will simulate the buttons you get from the API and render them on… 
- 
		1 votes1 answer335 viewsA: Filter array value in VUEYou needed to use the function filter from Javascript to filter the original list, follow an example of implementation <template> <div class="hello"> <input v-model="search" />… 
- 
		3 votes3 answers4398 viewsA: Difference between Promise and callbackA premomise is exactly what the name says, a promise. Its "promise" function that will return something, this something can be a success, error, message and etc. What will you do with what was… 
- 
		0 votes1 answer47 viewsA: How to filter the Chrome Devtools search for the file extension?After digging a little deeper into Chrome, I discovered: file:*.js string-para-procurar You can search in a specific file as well file:arquivo.js string-para-procurar… 
- 
		0 votes1 answer47 viewsQ: How to filter the Chrome Devtools search for the file extension?In Chrome Devtools it is possible to perform a search for some string in the files that were loaded by pressing Ctrl + Shift + F. What I would like to do is filter this search to find only files… 
- 
		2 votes0 answers16 viewsQ: Why jQuery’s . date() method does not update the data in the browser element inspectCan anyone explain why the method .date() of jQuery does not update (visually) the data shown when using the "inspect element" of the browser? The data is there because it is possible to use them… 
- 
		0 votes1 answer33 viewsA: Generate JSON data page in JekyllAfter some time of research I discovered the data files from Jekyll, at first I thought it was possible to read that data only through templates liquid, but after doing some tests I noticed that the… 
- 
		0 votes1 answer33 viewsQ: Generate JSON data page in JekyllI wonder if there is any way to generate a page with data on JSON (false data) in the Jekyll. The intention is to simulate a request AJAX for that page already preparing the code for when the data… 
- 
		0 votes1 answer256 viewsQ: Is reading files in Python updated in real time?I am developing an application where I will create a multithreading that will read a file .json and based on a key from this file (status: 'pending' or status: 'completed') I will perform an action… 
- 
		1 votes2 answers947 viewsA: How to perform a simple state and city search with jquery and jsonYou can use the method $.getJSON() from jQuery to recover data from your JSON page and there just select the data based on what the user typed. Take the example index.html // captura o evento de… 
- 
		5 votes4 answers82 views
- 
		3 votes2 answers1751 viewsA: Like counter with JS/Jquery?The problem is that you are losing the reference to the button you are clicking. This $(".like").html(count + "Curtidas"); will get all elements with the class .like. For your code to work will have… 
- 
		3 votes1 answer383 viewsA: How to add x icon at check-boxI have no experience with Ionic, but until someone with more experience can give you an answer, here’s a tip on how to do it with CSS. I used the following icon font (maybe it’s the same as Ionic,… 
- 
		2 votes2 answers109 viewsA: How to fix "dancinha" (Flicker) of icons Webfont when doing page Load?This Flick happens because your font has not yet loaded, in my applications I usually use a pre-loading, so these "problems" are not visible to the end user. If the pre-loading is not an option you… 
- 
		5 votes2 answers73 viewsA: Change of logo with CSS3There are several ways to do this, the problem is that with only CSS there is no dynamic way to do it. If you want to add more images in the future, you will have to update your code. I’d do it this… 
- 
		2 votes1 answer1993 viewsQ: 500 Internal server error in PHP filesEvery time I run a PHP file on the server it returns (in the header) an error 500. This only happens with PHP files... Commands like echo and phpinfo() only strings work (tested with echo 'teste';).… 
- 
		5 votes2 answers18380 viewsQ: Change svg color in :HoverI have a SVG inserted with the tag img on my website. I would like to know if there is a way when I do the Hover in this image it changes color but only with CSS? This is the contents of my SVG… 
- 
		0 votes1 answer621 viewsQ: Host two websites in a single VPSI am trying to host two different websites in the same VPS. What are the right procedures to do this? The server apache is already installed and I can host files there. However I can’t host two… 
- 
		12 votes2 answers2447 viewsQ: What is the difference between define() and const?What is the difference between declaring constants with define() or with const. Would it be the same thing or have some detail I should know? define('TESTE', 'constante 1'); const TESTE2 =… 
- 
		1 votes1 answer549 viewsQ: Refer to number of Mysql returnsI am trying to do a check in a database to check if there is a certain value, which should return me 0 or 1. In the query made manually inside the phpMyAdmin get success with my query. SELECT… 
- 
		8 votes2 answers1720 viewsQ: Which is faster, access data in file or database?In terms of performance which method is fastest to recover data, 1) read a file (which will be generated only once with PHP) or 2) take this data from a database? This data will always be shown on… 
- 
		4 votes1 answer4417 viewsQ: What’s the difference between print and echo in PHPWhat would be the difference between using print or echo in PHP, since both print a text on the screen. When it is most advisable to use which? echo "echo"; print "print";… 
- 
		10 votes1 answer1769 viewsQ: Compressing data with JavascriptIs there any way to compress data (strings) using Javascript? I am developing something for a platform where it is not possible to make use of any server language (at least on their host) and we do… javascriptasked waghcwb 1,915
- 
		5 votes1 answer781 viewsQ: How to save data to a global arrayI am studying PHP, and so far I have developed a small system that "mounts" the site views and etc. But I came across an extremely annoying problem that I can’t solve. I need a function to show the… 
- 
		1 votes1 answer417 viewsA: how to prevent an element from being reloaded when accessing other pages of the same site?If I understand correctly, what you want is to do an AJAX navigation. I know two ways to do this, which is by using AJAX (but you yourself mentioned that you don’t want this) and the other is a… 
- 
		2 votes1 answer101 viewsQ: Why define a constant for the same document and check if it exists in the document itself?I see in many codes out there programmers that setam a constant and in the document itself check whether this constant exists (was defined) in itself. I would like to know why this happens. When we… 
- 
		1 votes3 answers1694 viewsA: How to do when a button is clicked is created an element on the page?There are several ways to do this. If you are using jQuery you can use methods like after(), before(), append(), prepend(), and so on... Here is an example of use: // Conteúdo que deseja inserir var… 
- 
		2 votes1 answer164 viewsQ: Increase the size of a DIV manuallyI have a div with a list of items inside, I would like to know how to do a function so that when the user click another div below the list, he can resize the height of this div manually (Stack… javascriptasked waghcwb 1,915
- 
		7 votes1 answer412 viewsA: How to make dynamic animations with CSS3?Just complementing what you already found there for the guys you don’t know yet. CSS3 animations can be created using the property @keyframes, which by the way is a very powerful property. It can be… 
- 
		1 votes2 answers977 views
- 
		-1 votes1 answer272 viewsA: Pass dynamic SVG widgets to fileWell, if I understand correctly you want your user to create a SVG image dynamically with Javascript and then you want to create this image on the server with PHP, right? If it is, just make a form… 
- 
		1 votes1 answer11355 viewsA: Is there any way to check if a cell phone number is valid?Well, regex is not my strong suit. But I tried something for you here, I followed the following pattern: The value entered by the user must start with 8 or 9 - ^[9|8]; Should be followed only by… 
- 
		0 votes1 answer204 viewsQ: Update headers with AJAXI have an AJAX form that only shows a captcha to the user when the form is sent more than 2 times. I save those attempts on $_SESSION with PHP, but as the form is sent via AJAX captcha will only… 
- 
		9 votes1 answer14926 viewsA: Pointed Buttons and Text BalloonsExists in small "trick" using the edges in CSS which allows us to make triangular edges. I personally insert these edges with :after or :before. Here’s an example of how I would make your examples… 
- 
		5 votes2 answers148 viewsQ: Detect when a form is sentHow could I detect when a form is sent with pure Javascript? It would be the equivalent of this in jQuery $('#form').submit(function(event){ alert('Meu callback'); event.preventDefault(); }); I was… javascriptasked waghcwb 1,915
- 
		3 votes2 answers148 viewsQ: What precautions should be taken when sending an email via PHPI am developing a contact form for my site, as usual I first make it functional, and then work on the security of it. In the case of a simple form, which will only receive one field name, another… 
- 
		0 votes3 answers118 viewsQ: Is it dangerous to use for loop in querySelectorAll?Always when I need to select more than one element on a page it is not possible to use the querySelector() isn’t it? Then we should resort to querySelectorAll(). I’ve always used it the following… javascriptasked waghcwb 1,915
- 
		2 votes1 answer2865 viewsQ: Make a POST with AJAX and JSON with pure JavascriptI have the following code on jQuery $.post('/privmsg?', { folder: 'inbox', mode: 'post', post: '1', username: 'Wagner', subject: 'Título', message: 'Mensagem' }); I am studying Javascript, and would… 
- 
		1 votes2 answers2221 viewsQ: Dynamically change label valueI’m a beginner in Python. How do I change the value of a label dynamically? To be more specific, I have the following code: #!/usr/bin/env python from Tkinter import * import socket, webbrowser root… 
- 
		4 votes1 answer557 viewsQ: .each() in pure JavascriptOn a platform of forums there is a pagination system, and I would like to make this pagination via Ajax, for this, I built the following function: //<![CDATA[ var Pagination = (function(w, d) {… 
- 
		5 votes2 answers1037 viewsQ: Use "ping" on a Python siteIn Windows CMD it is possible to use the command ping to take the IP of certain websites, for example: ping www.facebook.com.br Is there any way to do something similar using Python 3.4?… 
- 
		18 votes3 answers1335 viewsQ: Why is it bad practice to use Javascript inline?The title already describes the question: why is it considered a bad practice to use CSS and Javascript inline in our codes? It’s bad to use it even on smaller projects? javascriptasked waghcwb 1,915
- 
		4 votes2 answers1258 viewsQ: Word filterHow can I make a Javascript word filter? For example, I have a div and within that div do not want there to be certain words that are inside an array: var badWords = ['teste', 'teste1', 'oteste2'];… javascriptasked waghcwb 1,915
- 
		2 votes1 answer89 viewsQ: Problem using while loopI have a input on a page where I type the ZIP code and can calculate the estimated value and time of delivery of a product for each region. By clicking the calculate button it will show a box loaded… javascriptasked waghcwb 1,915
- 
		0 votes1 answer76 viewsQ: Control Javascript page content according to who is orderingIt is possible to control the content of a script page according to the website that is ordering this page? For example if the site X make the request I show X to run if the site Y access I show…