Posts by Tobias Mesquita • 22,900 points
750 posts
-
2
votes5
answers1500
viewsA: Keep displaying the date and time in the javascript browser
André Nascimento, if all you want is to show the Date and Time in the Browser, I advise to ignore this counter and take the System Time, as I believe you want to show when the User Session is due to…
javascriptanswered Tobias Mesquita 22,900 -
4
votes5
answers142
viewsA: what is the best way to create elements?
as I said, it is best not to use string concatenation, follow an example with the use of Handlebars (Template Engine). Note that it is possible to add loops and conditions within your template.…
-
1
votes1
answer629
viewsA: input inserted with "append" is not "recognized"
Ivan, when you bind an event to a jQuery object, it will apply only to the elements contained in the object at that time. Remember that adding a new element will not update the previously obtained…
-
2
votes2
answers1271
viewsA: Mount array through a list in ajax
as an alternative to the Lucio method, you can also use the native Javascript map, where it mounts an array using the function return. Also note that you can continue to manipulate the array using…
-
1
votes2
answers543
viewsA: How to organize the return of data in a List<T>?
itasousa, I particularly advise against you formatting the return, this will only leave the size of your Sponse larger and will not bring you any benefits. In any case, you can change how WCF…
-
4
votes1
answer1289
viewsA: Post typing effect on placeholder
look, unfortunately there is no pseudo-seletor to the input that signals that it has an empty value or not, so if you hear a pseudo-seletor :empty I could give you a full answer. But we can use…
-
2
votes2
answers238
viewsA: What alternative to replace ASP codes with Javascript?
pnet, taking advantage of the idea of Maicom, you can put the variables inside a tag script in your ASP page: <script type="text/javascript"> var asp = {}; asp.ind_tipo_proposta_pj = "<%=…
-
5
votes2
answers1301
viewsA: How to expect everything to load before performing a function?
as you are generating the checkbox dynamically, you need to bind the click event when they are created. In your case, the easiest way to do this is to replace the following code string:…
javascriptanswered Tobias Mesquita 22,900 -
0
votes4
answers1021
viewsA: Add minutes to the hour
I think you could simplify your logic a little bit, so you could even include other fields more easily (like days or seconds). $(function () { $(document).foundation(); var inputs = {}; inputs.dias…
javascriptanswered Tobias Mesquita 22,900 -
1
votes4
answers966
viewsA: hyperlink mailto on button
as Sneeps pointed out very well, when the user clicks he will see the email. But I believe that your problem is not to expose your email to a user of the page, but to Bots that do the email…
-
2
votes2
answers1199
viewsA: HTML with bootstrap responsive layout
Luiz Negrini, regardless of using Bootstrap, you can use the strategy below, in case you will only need css to define the position of each element in the page. Note that everything depends on the…
-
0
votes3
answers14765
viewsA: How to check if any field of a specific class or type is empty?
friend, as you are using an input of type "email" and a placeholder, I think it would not be a problem to use a validation with HTML5, so just put the property required to require completion of the…
jqueryanswered Tobias Mesquita 22,900 -
2
votes4
answers4345
viewsA: Stop and restart setInterval function
In my view the only problem of the proposed solution is that the setInterval chronometer is rescheduled at the end of the execution, so if the interval is set to 10ms and the time calculation and…
javascriptanswered Tobias Mesquita 22,900 -
2
votes3
answers943
viewsA: How to sort DOM elements by jQuery?
follows another possibility, only without jQuery and based on a random list. var lista = document.querySelector("ul"); var itens = lista.querySelectorAll("li"); itens = [].slice.apply(itens);…
jqueryanswered Tobias Mesquita 22,900 -
6
votes1
answer74
viewsA: JS function does not perform calculation
From what I noticed your page has n Rmularios with a structure similar to the following: <form id="form1"> <input name="horas" type="text" onblur="value();" /> <input name="valor"…
-
3
votes2
answers321
viewsA: Script to make a div appear
You can check whether the ViewBag.Message is not empty, so display a message. Below is an example using jQueryUI: Controller using System; using System.Web.Mvc; namespace SampleApp { public class…
-
2
votes2
answers375
viewsA: Debug javascript object Chrome
You’re confusing Debug by IDE Development with Debug through the Chrome DevTools. to create Breakpoint, use F12 to open the Chrome DevTools, go to the tab Source, look at the list of sources and…
-
1
votes1
answer175
viewsA: How to create a popup with a dropdownlist?
In the examples below I will use the Zurb Foundation to open a Modal: If you want to open a Popup with a content that already exists on the page, you do not have to use a ActionLink, then the best…
-
3
votes1
answer1081
viewsA: How to call Procedure using Asp.net MVC with Entity Framework
first you have a model that represents the data returned by the previous: public class Categoria { [Column(Name = "id", Order = 1)] public int ID { get; set; } [Column(Name = "rownum", Order = 2)]…
-
2
votes2
answers167
viewsA: Best Solution for Web Service Rest
Pedro Simões, technically the ASP.NET Web Api is Open Source. In this case you can use the VS Code or the VS 2015 Community, as for tutorials for ASP.NET Web Api, you find them very easy on Google.…
-
2
votes1
answer474
viewsA: Search does not work on Jquery Modal Screen
pnet, from what I remember from your old questions, this page that you are loading in iframe before was opened in a pop-up. This way, this page should be communicating with the page that opened the…
-
1
votes1
answer1185
viewsA: Disable date in Datepicker from SQL Server table
mmooser, follow a slightly cleaner example: var diasSemana = [ "Domingo", "Segunda", "Terca", "Quarta", "Quinta", "Sexta", "Sabado" ]; var diasFinalSemana = [ "Domingo", "Sabado" ]; var…
-
4
votes2
answers1801
viewsA: list.foreach vs foreach
Next, in terms of performance there is no significant difference, you can even see this in the following fiddle: https://dotnetfiddle.net using System; using System.Diagnostics; using System.Linq;…
-
1
votes2
answers223
viewsA: Problem with overflow
look, I made an example here from scratch, maybe I can adapt your page: In case I’m using position Absolute instead of Fixed, so the menuWrapper has its size relative to wrapper. Instead of using…
-
2
votes1
answer60
viewsA: Jquery Scroll Smoth
you can create some property to inform that you do not want the effect to be applied to that element, in the example below I am using a custom data: <a href="#c" data-toggle="tab"…
-
1
votes1
answer1694
viewsA: Doubt when calling a modal jquery UI screen by passing an HTML page as parameter
I believe that the Abrepesquisa method is just a wrap for window.open, so in your Avascript file there must be something similar to the following: var AbrePesquisa = function (URL, name, title,…
-
1
votes2
answers2151
viewsA: jquery percentage calculation
opeta, try to do like this: P.S.: $.fn.val is a workaround to be able to set the value of the input after applying the mask. var originalVal = $.fn.val; $.fn.val = function(value) { if (typeof value…
-
2
votes1
answer339
viewsA: Performing checkbox checking with jquery
see if the code below is what you want. var frutas = document.getElementsByName("fruit[]"); var txt1 = document.getElementById("txt1"); frutas = [].slice.apply(frutas); var listCheckedOptions =…
-
0
votes2
answers200
viewsA: Centralize dynamically created div on top of another div
While I was doing the following, Kadu posted his. as it uses only pure Javascript, I decided to post anyway. And another caution should be taken, as the #window position is calculated relative to…
-
7
votes1
answer161
viewsQ: Edgejs and Entity Framework
Next, I am learning Nodejs and I am delighted with the same, however I found my first stone on the way, access to relational database using some ORM (precisely to access Postgresql). Initially I…
-
-1
votes2
answers570
viewsA: color a certain row, column during an iteration
realized an implementation that maybe is what you are looking for. var appExemplo = angular.module('appExemplo', []); console.log(appExemplo); appExemplo.controller('ctrlLista', ['$scope', function…
javascriptanswered Tobias Mesquita 22,900 -
0
votes2
answers710
viewsA: Error when adding reference to a web service
I tried to add the following Endpoint as Service Reference: http://sigep.correios.com.br/sigep/update/AtendeClienteService.wsdl Then returned me the following error: Metadata contains a reference…
-
0
votes2
answers553
viewsA: Make Javascript work on a certain screen size
If all you want is for a certain style to be applied only when the screen is smaller than 768px, then the best option would be to use CSS only. @media screen and (max-width: 768px) { .navbar-inverse…
javascriptanswered Tobias Mesquita 22,900 -
8
votes1
answer1874
viewsA: Catch the parent element in Hover
As you pointed out yourself, the pseudo selector .has() will only be available in version 4, but if it was already implemented in Browsers, you could do the following: nav:has(> ul li a:hover) {…
-
4
votes3
answers1500
viewsA: Copy bank record
Rafael, as you did not inform the purpose of your query, the table structure or the DBMS, I will give you two very generic alternatives for Sqlserver: 1 - Disable the Identity temporarily SET…
-
3
votes2
answers40368
viewsA: Alignment of text inputs in HTML/CSS
For this case there are some solutions. What I can advise you to do is to place the label and input on different Ivs and control their size through these Ivs. This way, all labels will have the same…
-
7
votes3
answers2830
viewsA: Extract data from txt file to use in autocomplete
In the link you sent you can download a TXT, with it is much simpler to work. Follow the text of the TXT in question: CBO2002 - Occupation Codigo Titulo ------…
-
6
votes1
answer71
viewsA: Replace words dynamically
You can use the method Path.Getdirectoryname var path1 = @"C:/windows/x.exe"; var path2 = @"C:/windwos/system32/exemplo.exe"; Console.WriteLine(Path.GetDirectoryName(path1) +…
c#answered Tobias Mesquita 22,900 -
1
votes2
answers199
viewsA: List validation with jQuery
I will redo your implementation using Javascript only. In this case the best thing to do is to create an array to store successful tasks. var button = document.querySelector("button"); var tarefa =…
-
3
votes3
answers498
viewsA: Write checkbox value to input
an alternative with pure Javascript is as follows: var ckbDias = document.querySelectorAll("input[name='dias[]']"); var txtDias = document.querySelector("input[name='dias']"); var ckbDiasOnClick =…
jqueryanswered Tobias Mesquita 22,900 -
3
votes2
answers2431
viewsA: From one table to another html table
In this case, the easiest way is to assign an event to all checkboxes, in this event you move the entire row to the desired table. //consultando todos os input to type checkbox na pagina //caso a…
-
2
votes2
answers201
viewsA: How do I return an existing item in my enumerable via Contains?
Look, you can do the following: public IEnumerable<Relacao> Listar(int codigo) { return this.Context.Relacoes.Where(relacao => relacao.Codigo == codigo); } Case Codigo be the PK of Relacao…
-
2
votes2
answers22499
viewsA: Add attribute to an element
The .setAttribute() has problems with IE compatibility up to version 8. As for performance, according to the Jsperf, direct access to property is faster. Opera 28.0.1750.40 obj.title = 'This is a…
-
2
votes2
answers514
viewsA: How to save date and time in a variable by clicking button
I would like to give a complementary information the reply of @Sergio, so there goes another "reply comment". Let’s assume that in your HTML has an element with a data custom attribute (data-*)…
jqueryanswered Tobias Mesquita 22,900 -
0
votes2
answers239
viewsA: Dataset with cloister Where like '%' @parametro Visual Basic 2012
I am basing myself on the following reply from Soen remove the % of your consultation: WHERE cod_cliente LIKE @clienteCnpj Then add them when adding the parameters:…
-
3
votes2
answers235
viewsA: OuterHTML return of elements
you can do the following: var menus = document.querySelectorAll("#menu a"); var outerHTML = [].map.call(menus, function(menu) { return menu.outerHTML; }).join("\n"); var textarea =…
javascriptanswered Tobias Mesquita 22,900 -
3
votes3
answers3224
viewsA: How big is the line break?
@haykou, note that the <br /> has its behavior affected by a simple \n, not to mention that the behavior of the css applied in the same differs a lot from browser to browser, so it is a…
-
3
votes2
answers5176
viewsA: jQuery dynamic table
@Felipearaujo, this is what you wish to do? var input = { Nome: $('[name="Nome"]'), Mnemonico: $('[name="Mnemonico"]'), } var documento = $(document); var linhas = $("#tabela tbody");…
-
1
votes1
answer66
viewsA: pick up customer with certain types of purchases
you can carry out the following consultation: public IEnumerable<int> getClientes(int itemID, int qtdMinimo) { return ( from venda in db.Vendas where venda.IDItem == itemID group venda by…
-
2
votes2
answers2828
viewsQ: CURSOR vs table variable type
I’m facing one of those situations where I need to perform an action for each line resulting from a query. This way I have two options, use a Cursor or a Table Variable, but the two seem very…