Posts by Tobias Mesquita • 22,900 points
750 posts
-
4
votes4
answers124
viewsA: Help in refactoring jquery code
you can use a property data-* to store the image selector, then just have a bind for all the elements. var images = $("[data-img]"); images.mouseenter(function() {…
jqueryanswered Tobias Mesquita 22,900 -
1
votes5
answers106
viewsA: link is not called
As @Pedrocamarajunior pointed out, you are trying to associate an event before it exists, in this case the ideal is to use the method on() in any relative closer to this element and pass a selector…
jqueryanswered Tobias Mesquita 22,900 -
0
votes2
answers77
viewsA: Doubt of relationship of tables
I tried to understand its structure from your comments, so I believe the following select solves your problem: SELECT Notas.id_nfcapa, Notas.cgccpf, Notas.tppessoa, Notas.nronota, Notas.serienf,…
sql-serveranswered Tobias Mesquita 22,900 -
2
votes2
answers80
viewsA: Problem with Jquery dialog
You are making the bind of an event on ready of jquery after the page is already ready, so this event will never run, so remove the $(function () { ... }) of the method CheckConfirm. Another point,…
-
6
votes3
answers954
viewsA: Vertical slider navigation including highlight thumbnails
I made an implementation that the gallery will have the same size of the element it belongs to, if this element occupies the whole screen, then the gallery will occupy the whole screen: I tried to…
-
1
votes2
answers1691
viewsA: How to make a Function wait for jQuery loaded with the async tag
you can use the library gowiththeflow to help you with this. To create an execution stream, instance an object of the type Flow, then call the method par to run something in parallel or seq for…
-
0
votes1
answer151
viewsA: Error in Javascript for Chekar Asp:Checkbox
you are trying to call a function before it is instantiated, with this the Script triggers an exception and the Function is never created, so the following change should already solve: function…
-
4
votes1
answer79
viewsA: Onmouseover with Delay when exchanging image
Since the two images are hosted on a remote host, it is natural to have to wait for the loading time of the same. In this case, you can pre-load the images, one of the ways to do this is with…
javascriptanswered Tobias Mesquita 22,900 -
3
votes2
answers6191
viewsA: Consume API (JSON) in form fields, how to do?
Follow an option using Javascript only (no dependency to jQuery). var form = {}; form.fipe = document.getElementById("fipe"); form.marcas = document.getElementById("marcas"); form.modelos =…
-
3
votes2
answers188
viewsA: Syntax error in Javascript
in addition to the syntax error pointed out by @Yurepereira, we still have Line 12 Error: var data[r]; You are declaring this array wrong, in this case you have two options: Without specifying the…
-
4
votes1
answer954
viewsA: Record video file after capture on site
I will post only the part of the Javascript submission, as you will receive in PHP and will process the Stream, this I will leave to your discretion. For the example below, I will use a input:file,…
-
4
votes3
answers523
viewsA: Get code from a li
You just need to replace the following line of code: arr.push(inputElements[i].name); for this: arr.push(inputElements[i].parentNode.parentNode); But I let myself make a suggestion, instead of…
-
3
votes2
answers4908
viewsA: Take the value of the Avascript table and place it in an array
I believe your code is adding new lines in the table body and not in the tbody, then the selector $('#tabelaPedido tbody tr') should not be bringing records. in any case, I am leaving a little more…
-
1
votes3
answers29544
viewsA: How do you get it in the headline?
you can leave your header and just position the #logo, #superior, #inferior within the header. header, div { box-sizing: border-box; } header { position: relative; width: 1220px; max-width: 90%;…
-
5
votes5
answers269
viewsA: Changing text in several different places of the HTML page
I believe that the best way to do this, is to make use of properties data-custom and a json with the values. i18n = {}; i18n["pt"] = { "name": "Nome", "contact": "Contato" }; i18n["es"] = { "name":…
-
0
votes3
answers167
viewsA: How to delete node in linked list?
Once you find No with the desired value, you only need to update the property next to No previous or the list start property. You don’t need to delete No, just destroy which reference you want it…
c#answered Tobias Mesquita 22,900 -
6
votes4
answers147
viewsA: Is there any way to decrease this script without losing functionality?
you can do it this way: var topmenu = $("div#contenthead div.topmenu"); var leftSpan $("div#contenthead div.left span"); var listas = {}; var spams = {}; listas.cursos = $("ul.cursos", topmenu);…
-
2
votes3
answers1751
viewsA: Receive Json array and insert into a loop with HTML
First thing, I advise you not to use id as identifier within a template, remember that you will have this set of cloned elements and it is not interesting to have two elements with the same id on…
-
1
votes2
answers966
viewsA: Validating form with onsubmit and javascript
If you need to perform validation through an AJAX request, then set a callback function as a parameter in the method validaFormALterar. function validaFormAlterar(acao, callback) { var opc = acao;…
javascriptanswered Tobias Mesquita 22,900 -
3
votes2
answers1388
viewsA: How to make a Link trigger a javascript function without redirection?
As the question does not have a jQuery tag, so I decided to add this answer in contrast to Ricardo’s. var meuLink = document.getElementById("meuLink"); meuLink.addEventListener("click",…
-
1
votes2
answers1344
viewsA: Open another page in modal Jquery
Since I have no knowledge of your UI, and you left open the technology to be used to open the Dialogo, then I will focus on the Ajax request itself. Model using System; namespace HelloWorldMvcApp {…
-
2
votes1
answer1014
viewsA: Specific time for the day of the week in the datetimepicker
I believe you are using xdsoft’s Datepicker. I say this because of the name of the events. Here is an example of changing the timetable according to the day of the week. var dayOfWeek = {};…
-
1
votes2
answers1323
viewsA: PHP and Javascript - Disable a Submit button if textarea is empty
I believe the event oninput is ideal for this type of situation, I say this pq it is triggered only when the value of the input is changed. In any case, I advise you to avoid setting JS and Styles…
-
2
votes6
answers886
viewsA: Regular expression to grab the background-image url
Taking advantage of the example posted by Gabriel Rodrigues. function verificaBg(id) { var arrayBg = []; var elemento = document.getElementById(id); var styles = window.getComputedStyle(elemento);…
-
3
votes3
answers14943
viewsA: A Base64 image loads faster than a url?
Look, I believe that the best is to pre-load the loading and error images and load the images through a Javascript. var loading = "http://cdn.flaticon.com/png/256/12334.png"; var error =…
-
0
votes2
answers1849
viewsA: Add a line at the end of the query in MS-SQL
Unfortunately the query below will only work in SQL 2005 or higher. It works for multiple warehouses, and will compare the first year in the history as the latest. WITH CTE_Res AS ( Select…
-
1
votes3
answers135
viewsA: Problem with Hover event in Firefox
Follow a suggestion using CSS only, in this case use a div instead of a img, in this case it will be important to inform the image size as well as the url of the same right in the CSS. .img { width:…
-
3
votes3
answers346
viewsA: .serialize() only lines marked with checkbox
I believe that there is no direct way to do this, so you will not need to go through all the lines, checking which are marked, grouping the related inputs, to then serialize the same. var form =…
-
1
votes2
answers74
viewsA: Combobox Css Help
To be able to style the Combobox, the first thing to do is to remove all the style from it, then wrap it in a div, and style this div. You need to style DIV instead of select, since select itself…
cssanswered Tobias Mesquita 22,900 -
1
votes2
answers958
viewsA: Asp.net - Prevent consecutive button clicks
You can disable the btnProximaEdicao button at the click; var btnProximaEdicao = document.querySelector('[id$="btnProximaEdicao"]'); function mudarEdicao(acao) { if (!verificarColunas()) return…
-
2
votes1
answer46
viewsA: Double Message Error Javascript Ajax
Look, the text teste is out of the Div#Reloadthis, so it is not being replaced. then just change it into the DIV. //evitar o uso de try-cacth dentro do setTimeout. var HttpRequest =…
-
1
votes2
answers114
viewsA: Receive variable value in 'Where in'
Another option is to use a table as parameter CREATE TYPE RelatorioType AS TABLE ( Codigo int primary key ); GO /* Create a procedure to receive data for the table-valued parameter. */ CREATE…
-
1
votes2
answers446
viewsA: Javascript - Showing and hiding Ivs according to selected checkboxes
Gustavo, although the @Randrade Answer is 100%, I would like to perform a review in your code. Try not to put Java and CSS inline in your HTML, then remove tags style and onclick. Try to group your…
-
3
votes2
answers420
viewsA: getElementById to modify 4 images with clicks link
friend, I had to do something similar some time ago, it follows the code I wrote. var container = document.getElementById("container"); var imagens = container.querySelectorAll("[data-sel]"); var…
-
1
votes2
answers55
viewsA: Generate one array according to another without bottlenecks
Look, I think the best way is to use a little Prototype and create two lists (Products and Category) and create references between them. var estrutura = [ { id: "1", name: "ProdutoA", categorias: […
javascriptanswered Tobias Mesquita 22,900 -
6
votes3
answers434
viewsA: What is the maximum value for javascript number?
In ES6 there is a constant to check the largest safe integer Number.MAX_SAFE_INTEGER, you can also check the maximum amount allowed using Number.MAX_VALUE , but it is worth remembering that it is…
javascriptanswered Tobias Mesquita 22,900 -
1
votes2
answers1088
viewsA: Orderby with accents
I won’t be able to help you with Angularjs, but I’ll try to give you an example that might come in handy. When you try to sort an array with names, really the names with Accento go to the end of the…
-
0
votes1
answer59
viewsA: Prevent Keyboard Layout Change when Applying Money Mask
I ended up modifying the script to change the input:type for tel, this way the keyboard that emerged was only the numeric and allowed the inclusion of other characters (thing that the…
javascriptanswered Tobias Mesquita 22,900 -
2
votes1
answer59
viewsQ: Prevent Keyboard Layout Change when Applying Money Mask
I am trying to implement a money mask using a Numberformat, but there is an unwanted behavior while running the script in Chrome for Android. Whenever a new number is inserted, the keyboard layout…
javascriptasked Tobias Mesquita 22,900 -
1
votes1
answer1412
viewsA: Print another page with javascript
look, in this case you better create an iframe for the content you want, up to the window.open may be blocked by Browser. var iFrame = document.createElement("iframe");…
-
2
votes3
answers63
viewsA: Id of Dice changes before JS time
Although the answer from @Sergio points out the problem, I believe it does not solve it, after all the id used in the internal scope is the same as the external scope. I tried to simulate your…
-
0
votes1
answer62
viewsA: Is it possible to load undescore templates externally with javascript?
Friend, the best thing to do is to automate the pre-compilation process, if you want to know how to do it using Grunt, you can read more about this link; you can also catch the recover script from…
-
1
votes2
answers1368
viewsA: Responsive form in HTML?
Leonardo, although there is not a single correct way to make a responsive Designer, what we can do is share our personal practice. In my case, I don’t usually set a size for the inputs, but for the…
-
1
votes2
answers1633
viewsA: Loop into function calling itself
Like I said, it’s to give you a full answer, it would be interesting to post your code with Indexeddb, so I’ll just post a generic response. for example, let’s imagine two Tables, Users and People,…
-
0
votes2
answers321
viewsA: Write a new html with js or jquery
Friend, I’d like to first give you a little advice, try not to use try-catch to control the flow of the application, after all try-catch is to treat mistakes, nothing more. As to the document.write,…
-
1
votes2
answers2872
viewsA: Grab element per id on another page by javascript
Let’s assume the following pages: Page A <input id="toggleMsg" type="button" value="Toggle Mensagem em Pagina B" /> Page B <style> .invisivel { display: none; } </style> <div…
javascriptanswered Tobias Mesquita 22,900 -
7
votes1
answer162
viewsA: How to create a textarea with multi columns (like a newspaper?)
Look, you can make the editable div .tres-colunas { -webkit-column-count: 3; /* Chrome, Safari, Opera */ -moz-column-count: 3; /* Firefox */ column-count: 3; } <div class="tres-colunas"…
-
1
votes1
answer364
viewsA: Positioning of div
Friend, to be able to centralize the div (central) on the page, you will have to apply a position: absolute in the same, then necessarily the div (content) can’t have a position: static, in this…
-
2
votes1
answer36
viewsA: FOD element identification standard
there is no conversion of names to HTML, but you can decide to follow some set of recommendations, as this done by Google If we follow the example above, then the correct one would be…
-
0
votes3
answers1081
viewsA: As I put a button inside iframe
Like the other Members, I cannot see the use of this approach, but one possibility is to create a document in memory: var iFrames = document.querySelectorAll("[data-content]");…