Posts by flourigh • 887 points
62 posts
-
0
votes0
answers21
viewsQ: How to Stop This Observable "unsubscribe"
Looking for a way to receive data inside a setTimeout, to do what you need and or stop your replay, I thought about creating a file, so when I receive the then or catch of this function, I stop the…
-
0
votes0
answers58
viewsQ: Function Improvement for Capitalize
This function returns me the first letter of each word in uppercase String(str).replace(/(^|\s)\S/g, (v) => { return v.toUpperCase() }) That is, this name Roberto if turn Roberto Monteiro but…
-
0
votes1
answer152
viewsA: Restricting access to routes if the user is not logged in Vuejs
use the "Guard" of the "router" to take the user from a "protected" route out of it if the "token" does not exist. router.beforeEach((to, from, next) => { if (findToken(to.meta.requiresAuth))…
-
0
votes3
answers66
viewsQ: Get Function value in javascript
Code: window.onscroll = function (e) { console.log(this.oldScroll > this.scrollY) this.oldScroll = this.scrollY } How do I turn this console.log in a Return and get the value false or true out of…
-
0
votes0
answers98
viewsQ: How to use Object.value in Vuex Getters module
in a. Vue or Vue html file, I can use a v-if with the following snippet Object.values(this.dialogs).filter((v) => v).length !== 0 and works as expected but in a file. js more precisely in a vuex…
-
0
votes2
answers58
viewsA: Dynamic class in Stylus
I had already left that aside, until today I discovered only by accident to have understood another factor of Stylus, ointerpolation with parameters, well, soon I discovered that I can do this way…
-
3
votes1
answer120
viewsQ: Search for array containing string and number
Hello, I have an array with the following extrusion ddd: [ 'SP', 11, 12, 13, 14, 15, 16, 17, 18, 19, 'RJ', 21, 22, 24, 'ES', 27, 28, 'MG', 31, 32, 33, 34, 35, 37, 38, 'PR', 41, 42, 43, 44, 45, 46,…
-
2
votes2
answers806
viewsQ: Regex date validation with 2/2/4 characters
Looking hard, I found some explanations on how to validate date with Regex but my knowledge in regex is a little limited yet. With some modifications in the explanations I found, I came to a nice…
-
0
votes2
answers58
viewsQ: Dynamic class in Stylus
Is it possible to retrieve a part of a class name in an element and pass as value to the CSS property using Stylus? Example .font-word-spacing-light--1 { word-spacing: -0.1px !important }…
-
1
votes2
answers706
viewsQ: I calculate value with Comma with Vue.JS
Good afternoon, Vue.JS can calculate directly in mustache {{}} but when a value comes with comma, Nan appears the result that is, if the variable is value = 2 and I do {{ value - 1 }} it displays 1…
-
0
votes2
answers28
viewsQ: Declare variable value in function call
I don’t know how to call this to Google search or if it is possible to do this. I have an object that is as follows: var clear = { Search_r: false, Search_f: false, Search_e: false } And I have the…
-
1
votes2
answers771
viewsQ: Sort foreach in php
I made a page that shows the hash in several hash_algos in order to study their differences, but I would like to sort by the hash size and not by the hash_algos name, the code is this, <?php…
-
0
votes0
answers293
views -
1
votes2
answers1193
viewsQ: Avoid notice in PHP display_error
I have this snippet of code, but many others follow the same style: if(!$_COOKIE[SITEINDEX]) { setcookie(SITEINDEX, max(explode('/', dirname($_SERVER[PHP_SELF])))); define(siteindex, '/' .…
-
0
votes1
answer53
viewsQ: PHP error when host changes
Good afternoon, I used an online host with php 7 and I had the following syntax if(!saber_se_não_existe) {} It always worked as well as this if(saber_se_existe) {} So much so that I rediscovered my…
-
-1
votes4
answers19850
viewsA: How to get the key pressed?
I see your doubt has been resolved, but it costs nothing to leave a little plugin with just the desired, know which button code was pressed http://dkteclive.com/plugins/keymap.html <script…
javascriptanswered flourigh 887 -
1
votes1
answer686
viewsA: CSS and JS does not load on mobile, via localhost
use this to create the base_url or constant variable <?php define('siteprot', $_SERVER['HTTPS'] ? 'https://' : 'http://'); define('sitehost', $_SERVER['HTTP_HOST']); define('siteuri',…
-
1
votes1
answer86
viewsQ: Preserve line breaking when Replicate val() content in span
Good afternoon, according to this topic - /questions/203969/replicar-conte%C3%Bado-de-val-em-span I have the following code $('textarea.skills_knowledge').blur(function() { var skills_knowledge =…
-
2
votes2
answers108
viewsQ: Replicate val() content in span
I found this code that works very well in inputs: <script> $(function() { $("[name='email']").keyup(function() { var email = $(this).val(); $("[name='login']").val(email); }); });…
-
1
votes1
answer51
viewsQ: Improvements in dynamic content
Good afternoon, I have a function in jquery that I have been improving since I discovered it in forums, it serves to create elements dynamically using jquery /* função que insere e remove cadeia de…
-
0
votes3
answers611
viewsQ: Calculate values within all inputs with class='Quant'
I have a function that inserts inputs dynamically in a div enabling the creation of a shopping list, tasks, or what the imagination allows, this also has a button that removes the item you no longer…
-
0
votes1
answer50
views -
1
votes1
answer495
viewsA: Keydown function skipping an input on TAB
Edit I solved after many, but many tests frustrated, I will put the code to whoever is going through the same case, I had to insert a lot of functions inside the tab to make it work right…
-
1
votes1
answer694
viewsQ: Dynamically calculate input with jquery
Good afternoon, I have a dynamically input input code function new_input() { $('<x>' + '<input class="cod" id="focus' + rscn +'" placeholder="Código" />' + '<input class="desc"…
-
1
votes1
answer495
viewsQ: Keydown function skipping an input on TAB
Good afternoon, I have a function that when I hit enter it creates a new series of inputs in the first line pushing the filled ones down, I made that when I hit the tab in the last one the same…
-
0
votes1
answer50
views -
1
votes4
answers80887
viewsA: How to force the opening of a link in another tab and not window?
you can also make good use of this, just like I did: window.open("url", "_blank"); Source: http://www.w3schools.com/jsref/met_win_open.asp…
-
0
votes2
answers59
viewsA: Scroll effect with opacity works but with transfform does not
With the remark of @Ricardo Moraleida I managed to get to the following code var max_pespective_rotatex = 90; var min_pespective_rotatex = 0; var rotateX = max_pespective_rotatex - (…
-
0
votes2
answers59
viewsQ: Scroll effect with opacity works but with transfform does not
Good evening, I have this code that works one part and the other part does not. $(document).on('scroll', function() { /* funciona */ var max_opacity_arrow = 0.3; var min_opacity_arrow = 0.1; var…
-
2
votes3
answers809
viewsA: Opacity according to page scroll
Thanks to our friend below, I got the following code that I will leave to those who also need this kind of help. $(document).on('scroll', function() { var max = 0.3; var mim = 0.1; var opacity = max…
-
2
votes3
answers809
viewsQ: Opacity according to page scroll
I have the following complication: $(window).scroll(function() { $('ID').css('opacity', parseInt(1 - ($(this).scrollTop()/100)*1)); }); In this code I can put opacity: 1; when the scroll is at the…
-
0
votes1
answer287
views -
2
votes1
answer55
views -
1
votes3
answers2365
viewsA: How to verify if connected in the database?
Thanks to the comrade’s help Tiago NET I built this script with safety techniques and fully functional for you, I have been perfecting the way I connect to my database from time to time and today I…
-
1
votes1
answer330
viewsQ: CSS attribute with text line condition
Good morning, these lines make appear in my user-agent is being used by the client, it helped me with problems in the Trident engine that does not interpret the gradient in the text and works very…
-
-1
votes1
answer61
viewsQ: Decrease a multidimencional array
Good evening, I am with a dilemma, I have tried in many ways but my knowledge with array is still vague, I would like help in the following, I have two arrays, one of them I already solved with a…
-
0
votes1
answer596
viewsQ: Pick up information from one foreach with another foreach
I have a mysql search that brings me the following array when using a foreach, I have another sql search that brings me all the fields of a table that in case are the same field names that are below…
-
-1
votes4
answers781
viewsA: HTML/PHP Detect if form value has been changed
You can give a session_start(); making it generate a single session for each browser even if used by the same username in different browsers, each will have a different Sesssion, what you can do is…
-
2
votes2
answers1057
viewsQ: Improve code to only get value from localstorage
I have the following code: jQuery.ajax({ type: "POST", data: $(accent_color).serialize(), success: function(data) { console.log(data); } }); How do I get this code to pick up the value below: var…
-
3
votes1
answer4285
viewsQ: pass javascript variable to catch with php post
Good afternoon, I found numerous ways to pass javascript to php but no way worked. thought in a way but do not know how to effect, saw that with ajax would be the only way I think, what I thought…
-
7
votes1
answer3632
viewsQ: How to know which jquery version was loaded
The code below shows me perfectly if the jQuery was or was not loaded: if (jQuery) { $('div#home_login').attr('style', 'background: green'); } else { $('div#home_login').attr('style', 'background:…
-
0
votes1
answer156
viewsA: error with input validation
I think I figured, I don’t know if it’s right, but it seems to work $('form input[type="text"]').on('input', function() { var inputempty = false; $('form > input').each(function() {…
-
0
votes1
answer156
viewsQ: error with input validation
the following code was implemented from a question I found here in the system $('form input[type="text"]').on('input', function() { var inputempty = false; $('form > input').each(function() {…
-
0
votes1
answer56
views -
0
votes1
answer381
views -
-1
votes1
answer381
views -
2
votes12
answers5446
viewsA: How to remove accent in upload with php?
function removeAcentos($string, $slug = false) { if(mb_detect_encoding($string.'x', 'UTF-8, ISO-8859-1') == 'UTF-8'){ $string = utf8_decode(strtolower($string)); } $ascii['a'] = range(224, 230);…
-
0
votes0
answers829
viewsQ: Do not display null lines in mysql results
I have a simple mysql query SELECT usr_contact FROM $usr_ I use PDO to connect this table has lines that have empty fields thus ----------------------- | id |usr_contact| ----------------------- |…
-
1
votes2
answers87
viewsQ: Mysql PDO array with Json error in view
I’m having a hard time with json_encode echo json_encode($autocomplete -> fetchAll(PDO :: FETCH_ASSOC)); i am doing a database select so far so all right, but when it transfers the data to this…
-
0
votes0
answers71
views