Posts by bio • 2,736 points
87 posts
-
1
votes2
answers160
viewsA: How to search accentuated text, upper case, and minuscule text with html and javascript?
What you can do is turn the uppercase characters into lowercase or vice versa in both cases for comparison. With respect to accents, you can replace them using a regex. You would need to pass the…
-
0
votes0
answers306
viewsQ: Which is more performative: "WHERE id IN (?, ?, ...)" or "WHERE id = ? OR id = ? (...)"
I am not an expert in Mysql, but I am studying and lately I am trying to improve some codes of my programs and I came across this situation. I wonder if there are differences between the querys…
-
0
votes1
answer36
viewsA: Loop that changes the Hue-Rotate
There is a logic error in your code. When you run the querySelectorAll you are capturing all the image objects and placing in a looping where all the images are using the same pointer i that was…
-
4
votes1
answer2435
viewsA: Possible combinations of (A to Z) and (0 to 9)
It works roughly as below. I will try to explain in the simplest way I know: Total letters: 26 (taking into account only the capital letters of the common alphabet) Total numbers: 10 (0, 1, 2, 3, 4,…
-
0
votes1
answer94
viewsA: How to get the X and Y strings of a movieclip in Actionscript 3 or Javascript?
To access an object created on stage, such as your Movieclip for example, you will need to use this (as well as much of the global functions) before: var movieclip = this.movieClipNoStage;…
-
2
votes1
answer190
viewsQ: Why suppress zero before the point in decimals, as in 0.5 == . 5?
Sometimes I face a code where the programmer wrote a decimal without zero, like 0.5 being .5, for example: var decimal1 = 0.5; var decimal2 = .5; console.log(decimal1 == decimal2);…
-
2
votes1
answer81
viewsA: Javascript function does not work
The val() jQuery is a method, so you need to treat it differently from a variable (which stores a value and you can change it with the syntax you used). To set the value from within an element with…
javascriptanswered bio 2,736 -
1
votes2
answers737
viewsA: How to get the value and label of a datalist using jquery?
In fact, the command $("#estabelecimento").val() returns what is inside value. It seems you want to return what’s inside the label of the datalist option object. You can browse the options within…
-
4
votes1
answer200
viewsA: Laravel call variavel
In fact its variable is not called $teste1 in your View. You are passing it as teste. That means you have to retrieve it as $teste. The line you pass the variable is this: return…
-
2
votes2
answers654
viewsA: Get src attribute content in <img> tag via javascript
I think you are performing an unnecessary check. You can put this condition as soon as you change the type of your text field: <script> function mostraSenha(e) { var x =…
-
1
votes2
answers381
viewsA: How to find out if your browser console is open?
Complementing the @Julianonunes response, you can create a function for this, as the variable will continue with the value true if the user opens the console and then closes it. Thus, you can run it…
-
4
votes3
answers2563
viewsA: Is it possible to apply sound effects to Hover or click css?
I believe it is not possible to play a sound with CSS only. Sound on a page runs as content, using the element <audio>. CSS is only used for stylize this content, therefore not being able to…
-
5
votes1
answer107
viewsA: Why Returns Nan? and how to return Number?
The mistake is in this.indice. You are trying to access a property of your object ContaPoupanca which does not exist, instead of accessing the function parameter. The correct one is only indice.…
javascriptanswered bio 2,736 -
6
votes2
answers2049
viewsA: Sort CSS DIV positioning
You can use the Flexbox. He works as a flex container, capable of sorting and directing the elements children. To use it, you need to determine display: flex; and direct according to the…
-
0
votes1
answer107
viewsA: Include if in query
You may have to study a little more programming logic. The solution seems to be quite simple, just close the concatenation on the first line, before the if. Then you proceed with it after it. And do…
-
5
votes1
answer249
viewsQ: How did this site "manipulate" the mouse position?
As usual, that question there is already an answer to that. Unfortunately I was surprised to browse a malicious site unintentionally. He was able to manipulate the mouse position, preventing me from…
-
1
votes2
answers311
viewsA: A jQuery Get() inside another jQuery get()
When making an asynchronous request you should wait for a response. If you place a request within a for, including a variable change (as in username = valor.nickname;), values will be scrambled and…
-
1
votes2
answers139
viewsA: Javascript function does not work
Your for is not traversing the recovered elements. You need to change it to: for(var i = 0; i < objs.length; i++) ... Then, when you will insert a value into a style you need to specify the…
javascriptanswered bio 2,736 -
2
votes1
answer1920
viewsA: How to update the page and run a javascript function
Well, first I advise you to use the method window.location.reload() to reload the current page. Then you can use the sessionStorage to save a variable to the current user session, thus: // execute…
javascriptanswered bio 2,736 -
3
votes2
answers80
viewsA: how to make a substring in an int in PHP
When you retrieve any variable that is of type integer, automatically you are transforming 001 in 1. As your default has only 3 numeric digits you can use sprintf: sprintf('%03d', 001); In your…
-
2
votes1
answer2032
viewsA: Clear select element with Javascript
When you use the Selectize.js he hides his input and creates a number of elements (Divs and another input) to create the inbox for tags and options. This means that it is not advisable for you to…
-
1
votes2
answers94
viewsA: Variable value is not changed inside ajax
Asynchronous request When you execute a method in Ajax you are performing an asynchronous request, implicitly created by the object Xmlhttprequest. This function is the waiting of a reply, it means…
-
3
votes3
answers59
viewsA: Take part of the value of the field
Simple, just use it substr(0,3). This method works by receiving two types of parameters: The first parameter is the initial index that you will take from your String, in this case, being the first…
-
5
votes2
answers116
viewsA: Is there an alternative to using for in php?
You can get the same result using the while with a counter and a condition that would be used in the for, thus: $contador = 0; while($contador < 10) { echo "O contador agora é: " . $contador .…
-
3
votes2
answers5448
viewsA: Is it possible to mirror an image horizontally (flip) with Canvas?
You can use the context.scale(-1, 1); and pass as parameter the width of the image times -1 when performing the drawImage() of context. var onload = function() { var canvas =…
-
2
votes3
answers277
viewsA: Overwrite native HTML scroll
Why Alert 'locks' the scroll? The boxes of alert(), confirm() and prompt() are in a layer outside the programming bubble of your website. It means that you have limited control over them. Who…
javascriptanswered bio 2,736 -
2
votes1
answer65
viewsA: Why doesn’t this program work in Chrome?
The tag option contains the global HTML events and this includes the onclick(). For some reason this link may or may not work in some browsers. This is because the event is not used onclick() in the…
-
0
votes3
answers917
viewsA: JSON: Insert an element into a given index (or key)
You can add the property and use the second parameter of JSON.stringify to turn the object into String and maintain an order in your JSON view, passing an Array with the properties in the order you…
-
1
votes2
answers184
viewsA: Is it possible to set a timer before running a post/Reload on the page?
You can use the global function setTimeout, it serves to create a delay simple before single execution of some function passed in the parameters. setTimeout(teste, 2000); // vai executar a função…
-
2
votes1
answer1009
viewsA: Regular expression for number, commas and points
Try the following expression: [\d\.\,]+ In your code: var total = $(".totalEstimadoVigente").html().match(/[\d\.\,]+/g).join(''); The return value with String Total Estimado Vigente: R$ 209.502,84…
-
2
votes2
answers2655
viewsA: How to format dd/mm/yyyy date to mm/dd/yyyy
Following this date pattern, you can use: function formatarData(data) { // da "split" no 'espaço' var d = data.split(" ")[0]; // recupera 23/03/2012 var h = data.split(" ")[1]; // recupera 00:00:00…
javascriptanswered bio 2,736 -
2
votes2
answers54
viewsA: Why does a Function invoked by onclick not influence external commands to it?
Maybe you need to learn what it is Programming Oriented to Events. Javascript is an event-oriented language (at least superficially) and this paradigm controls the flow through external indications,…
-
7
votes1
answer1571
viewsA: What does "{{ __('Login') }}" mean in the Laravel layouts file?
The function "helper" __() Standard performs the translation of the string or translation key according to the user’s location, as informed in the official documentation. You can spend both…
-
0
votes2
answers1042
viewsA: Button does not direct to another page
The problem is that when you use the element button within an element form it automatically executes the parameter action from the form, sometimes even ignoring the functions assigned to it.…
-
1
votes1
answer345
viewsA: How to take data from an input and add the properties of a Javascript function?
It seems there’s something wrong with your code. You’re giving return true without at least doing any checking. It is calling function validarUser within itself, causing a pile burst. Another…
-
1
votes1
answer72
viewsA: Adobe Air integrate Flex Componets
You will not be able to use Flex libraries on AIR AS3 by having different Sdks and compilers. The Flex SDK is almost an extension of AIR SDK, but not fully compatible as there are distinct project…
-
2
votes1
answer1749
viewsA: How to resolve "Cannot read Property 'substring' of null" error
First, I recommend you rename the variables start_date and end_date not to create any conflicts with the parameters passed to the return function. To facilitate a little we will rename the…
javascriptanswered bio 2,736 -
0
votes1
answer785
viewsA: How to make a JSON with an object array
You can use serializeArray() jQuery to transform form values into json. The problem is that this serialization usually returns objects similar to { 'name' : 'nome', 'value' : 'João' } and so that…
-
1
votes1
answer57
viewsA: Unnecessary exclusion
The problem is adding the function/event of click in the object of the modal .confirmado, in that line specifically: $("#modal-confirma").modal().find(".confirmado").on("click", function(){ When you…
-
0
votes1
answer47
viewsA: How to retrieve and send information from the form created by email?
You can create an identifier for these tables that you are creating, such as a class called table_produto, for example. Then, to recover all instances of the tables you created, you use…
-
4
votes3
answers1526
viewsA: Has Actionscript become useless?
I have been working with technology for a few years, since its peak. I can say that I have experienced the ups and downs of the actionscript-3 and I was sad to learn that in 2020 Adobe will…
-
0
votes1
answer121
viewsA: Load RTF content into HTML component
Does not work because the Sceditor plugin creates a iframe for displaying the contents of textarea. You cannot directly change the textarea, or if you do, you should also update the plugin sceditor.…
-
2
votes1
answer63
viewsA: List results with jquery/php
The type of response in the request ajax is asking for an object json, but the php code is doing the opposite: encoding a json for an object through the json_decode. To correction was to exchange…
-
1
votes3
answers320
viewsA: convert value to 2 decimal places in JS
You’re giving substr in the value of x, taking only the first three houses of the String of 202101000000. If you want to add decimals, you should insert a comma and the rest of the boxes in the 2…
javascriptanswered bio 2,736 -
1
votes1
answer801
viewsA: Compress external JS files
You can use the PHP-JS-CSS-Minifier, it is a PHP library that compresses javascript and css files in real time and saves them to a project folder. It relies on the site’s API Javascript Minifier.…
-
0
votes1
answer338
viewsQ: What is the best way to store Google Maps points in the database?
I am developing a system that will store some Google Maps paths of registered users and structured my table as below: ---------------------- | trajetos | ---------------------- | id | | id_usuario |…
-
1
votes1
answer1472
viewsA: Laravel Search Form 5.5
You can pass an array of conditions within the where of your Query Builder using the input variables of your form. Maybe something like: public function index(Request $request) { $filter_id =…
-
0
votes2
answers697
viewsA: How to simulate a CTRL + V with javascript
The command document.execCommand('paste') has never been a stable Javascript command. It was a temporary solution created to help developers program in the version Chrome Dev and is apparently part…
-
4
votes1
answer686
viewsA: Validate field with integer value, in decimal format (check if value is less than)
The error is happening because in javascript language the decimals are separated by . and not by ,. So, if you "parse" a string that contains a point for int, the number becomes a different integer,…
-
1
votes0
answers33
viewsQ: How can an external swf access the Stage within the document class?
I have a main swf that loads other swfs. Everything works correctly with the code below that is within the main swf (sketch): var loader:Loader = new Loader(); stage.addChild(loader);…
actionscript-3asked bio 2,736