Posts by Joao Paulo • 11,760 points
262 posts
-
3
votes1
answer128
viewsQ: Application stopping when there are many users accessing
My application is crashing and I don’t know exactly why. The only thing that repair is that when there are many users accessing, or making requests it happens. When it happens I have to restart the…
-
3
votes1
answer112
viewsA: How to solve margin calculation problem in Javascript?
There is an error in the add function: The correct is: var inteiro = valor.substring(0,valor.length - 2); var decimal = valor.substring(valor.length - 2, valor.length); All "console.log" snippets…
-
2
votes2
answers971
viewsA: Problems with calculations in Javascript
Try it like this: $(document).ready(function () { $(".valor").on("input", function () { // Margem var valor = $(this).val(); var valorCorrigido = parseFloat(adicionarPontos(valor)); var valorFloat =…
-
0
votes1
answer62
viewsA: Click event is not working
See if I got it right: var teste = {}; teste.uai = function(valor){ alert(valor); }; teste.testando = function(element){ if(($(element)).is(":checked")) { var valor = $(element + ":checked").val();…
-
1
votes2
answers1412
viewsA: Change CSS display with PHP variable
Follows possible solution: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Meu Contator</title> <link href="css/estilo.css"…
phpanswered Joao Paulo 11,760 -
3
votes2
answers22610
viewsA: How to take the value of one input and assign it to another?
You can update the relative cost while typing, for example: HTML (create a "value" class and a "cost" attribute to make it a little more dynamic): JAVASCRIPT: $(document).ready(function(){…
-
5
votes1
answer8184
viewsQ: Is there anything similar to WITH(NOLOCK) of SQL SERVER in ORACLE?
I recently discovered in SQL SERVER the option of not blocking tables for insertion while reading some data, and with this gain some performance in some specific situations. I searched, but I did…
-
0
votes2
answers455
viewsA: Dynamically Loaded Content Handling
In this case use . attr and not . css. Would look like this: $("#P2Telefone").attr('style','width:100%'); But since your element is being loaded via ajax, you will need to enter this code within the…
-
2
votes2
answers187
viewsQ: How would a regular expression find an attribute html + attribute value?
I want to give a find/replace in all the attributes html "data-placeholder" and its values, of my application, through the search of Visual Studio. For this I need to assemble a regular expression…
-
2
votes1
answer45
viewsQ: How to add a feature to jQuery?
I have some ready-made functions that format date, take only string numbers, block fields so as not to allow letters etc. Examples: function formatarData(data){ // conteúdo da função return data; }…
-
5
votes1
answer998
viewsA: How to get the full screen size even if the browser window is resized?
I found that with this Javascript code I get the height and width: var altura = screen.height; var largura = screen.width:
-
3
votes1
answer998
viewsQ: How to get the full screen size even if the browser window is resized?
I can get the size of the browser window through the following code: $(window).height(); However, this method takes the current size. I wonder if I have how to get the full size of my screen even if…
-
1
votes2
answers7016
viewsA: remove element css
In the examples you quoted, to remove through the inline class or style this code works: $("titulo").attr("style", "").removeClass("titulo"); However, there are other situations that would require a…
-
1
votes2
answers525
viewsA: How to pass value to label in modal
Try it like this: $('.modal-body label').text(descricao)
-
1
votes2
answers206
viewsA: Change attribute "src" with fadein effect
Fadein only works on hidden elements. If the image is visible and you just change src and call fadein, no effect will occur. In order for it to work properly you need to make sure that the image is…
jqueryanswered Joao Paulo 11,760 -
2
votes1
answer56
viewsA: Problems with . clone() to radio Buttons
Radio Buttons "interact with each other" through the name. When you clone a line with radio Buttons you are in fact adding new options to radio Buttons from the previous line. I suggest you create…
-
2
votes1
answer140
viewsA: Table multiplying the data
You are entering all the sales table records every time. You have to add only the last record. Try it this way: INSERT INTO vendaproduto (id_venda, produtos) SELECT venda.id_venda, venda.produtos…
-
4
votes1
answer56
viewsA: What’s wrong with this concatenation?
With $('#cities') you’re not getting any value. You’re getting an Object. If #cities is an input, use $('#cidades').val() Note that you did it correctly with $('#States'), using . val(), but if…
-
2
votes4
answers16240
viewsA: HTML -Spacing between tds
I got the effect you need by placing a class in the td of the column in question and using a custom css for it: td { background: gray; padding:10px } .tdEspaco { display: table; float:left;…
-
2
votes2
answers658
viewsQ: Can I generate a certificate for an IOS app without an Apple device?
I am developing an app via phonegap and would like to generate for IOS too, only I need a certificate, and so I saw this certificate has to be generated by a Mac. Is there any other way to generate…
-
4
votes1
answer330
viewsQ: How to filter a List<Dictionary<string, Object>?
I have a list variableMatriz that is a List>. She has 108 items. The listMatriz[0] looks like this: What I wanted was for the list variableMatrizFiltrada to come only with items from the Triz…
c#asked Joao Paulo 11,760 -
12
votes4
answers595
viewsQ: How to create a variable where to access its properties via string?
I’d like to access by string the properties of an object: (EXAMPLE 1) var cor = casa["cor"]; var tamanho = casa["tamanho"]; Instead of accessing like this: (EXAMPLE 2) var cor = casa.cor; var…
-
4
votes2
answers2151
viewsQ: How to shift the focus from one Textbox to the next?
I’m trying to shift the focus of the field after the user writes 2 digits. Validation is ok, but I haven’t found a method to change focus. NOTE: It is a dynamic method used for various fields, so I…
-
4
votes1
answer3589
viewsQ: How to assemble a page for printing within the application code?
I need to assemble a printing page inside my code, that is I will not print an existing document, nor the application screen, I want to assemble the code execution with the elements I want. I have…
-
16
votes2
answers1211
viewsQ: What is the difference between using (int)variable or Convert.Toint32(variable)?
What is the difference between them? At what times is it more appropriate to use one or the other? Examples: string palavra = "10"; var numero = Convert.ToInt32(palavra); // ou (int)palavra ? string…
-
1
votes1
answer251
viewsQ: Problem with "on change" followed by "on click"
I have the following HTML code: <input type="text" id="esc" /> <input type="button" value="Ok" id="ok" /> And jquery/javascript: $(document).on("change", "#esc", function(){…
-
3
votes2
answers74
viewsQ: Is there any way to debug through the browser to stop exactly on the line being executed?
I picked up a complex code for maintenance and noticed that a table is constantly updating causing page slowness. I wonder if you have any browser options (Chrome preference), that allow me to stop…
-
3
votes2
answers758
viewsA: Certain function does not work in Firefox
There are several reasons that can make your code not work, here are some tips: Try passing the function over the calling code. Clear the browser cache and Inspecione if your code has been updated.…
-
0
votes2
answers1736
viewsA: Jquery does not load to localhost
When you do not specify the protocol in this way: "//dominio.com/code.js" the browser complete with the protocol of your page. If you are on http://localhost/ he’s gonna get the http, if you are…
-
0
votes1
answer159
viewsQ: How to get a specific version of a library via Nuget?
I need to use a library with a specific version in an old project. I remember once downloading another library from the Nuget console specifying the version, but I do not remember and I do not know…
-
6
votes1
answer97
viewsA: How to run a javascript using href?
In your script failed to close the logout function logout(){ //conteudo } You can also exchange href for onclick: <a onclick="javascript:logout()">Log Out</a>…
-
5
votes2
answers378
viewsA: Problem picking textbox value with jQuery
To get the value of textbox with jquery would be like this: $("#txtSenha").val();
jqueryanswered Joao Paulo 11,760 -
4
votes2
answers535
viewsA: How to access Action in another Controller via Ajax?
Just put as string, do not need to use C code#: $.post('../Area1/MeuControllerArea1/MinhaActionArea1')
-
3
votes3
answers2089
viewsA: Calculate on which days of the week the days of the month fall
How to get the amount of days of the month: function daysInMonth(month,year) { return new Date(year, month, 0).getDate(); } //Pegando a quantidade de dias do mês de fevereiro de 2015…
javascriptanswered Joao Paulo 11,760 -
4
votes3
answers1766
viewsQ: How do I get the column number of the table where an input I’m writing is?
I have text inputs in cells of a table. <table> <tr> <td>Bola</td> <td>Casa</td> <td>Arvore</td> </tr> <tr> <td><input…
-
1
votes2
answers652
viewsA: How do I get the same results I have in common Google Search, via the Google Search Api?
There is no way because I was using an old API to Google Web Seach API, which is obsolete. I’ll switch to the current Google Custom Search API to try to get the results I need.
-
4
votes2
answers1558
viewsQ: Global variable query in a controller
I have a method in my controller that is called through ajax. It populates a global variable within that controller. Is there any way I can access this global variable already populated by the first…
-
4
votes3
answers3438
viewsQ: How to receive a pdf file via ajax?
I am using this method to return a PDF file. It works normal if I call this action directly via URL: public ActionResult GerarProva(int idEpo, int numero, bool existeProvaGerada) { try { var…
-
4
votes1
answer315
viewsQ: Is there any possibility of performing a javascript action after the end of a download?
I have a link to a PDF on my site. I would like the page to enable another button at the end of your download. But the question is: this is possible only with javascript/jquery? If yes, how would it…
-
1
votes2
answers652
viewsQ: How do I get the same results I have in common Google Search, via the Google Search Api?
When I search Chris Brown through the api I get these results: But in Google search by browser the results are different: Assumptions: Through the site search, even if I am not logged in, the search…
-
5
votes2
answers188
viewsQ: Is there a jQuery selector that takes the html from its own tag and also the content?
Example: <div id="quadro" style="float:left"> <h1>Quadro de horários</h1> </div> If I use $("#quadro").html() I only get H1, but I want H1’s html and div’s own. I need…
-
3
votes1
answer192
viewsQ: Select, by quantity, items that match conditions
I have a question when it comes time to mount a query. I’ll set up a fictional scenario to demonstrate. I have the table quantidadeQuestoes with the fields: cod_nivel cod_categoria cod_difficulty…
-
5
votes4
answers243
viewsA: Script making many improper requests
If I understand your code correctly it can be summed up to this: $(document).ready(function () { $('#btnprox,#btnante,#btnprim,#btnulti,#btnnovo,#btnexcl,#btncanc,#btnsalv').click(function(){…
-
1
votes2
answers106
viewsA: Why does Graph API only return to 25 groups?
Use the limit parameter in your request. I think it has a maximum of 5000 items per page. Example: FB.api("/"+ idGrupo +"/members/?limit=5000", pegarUsuarios);
-
0
votes3
answers235
viewsA: How to check by javascript if you have entered a new li tag through setInterval?
Use this event outside your setInterval: $('ul').bind("DOMSubtreeModified",function(){ alert("ul foi modificada"); }); If your ajax is just adding new messages, ie li for the message, this will…
-
1
votes1
answer3034
viewsQ: How to select by taking the record that has the maximum value of a field?
I am doing a select that is seeking records that meet some conditions and then should take from them only the record that has the maximum value of a given field. It’s like this: SELECT…
-
4
votes1
answer801
viewsQ: How to group items in a list with a proper condition?
I have a list with a property called tamanho which may contain two values: "M" or "I". I need this list to be random, but with a grouping condition. "M" would be half page and "I" full. That is, I…
-
2
votes1
answer704
viewsA: How to know the dimensions of an image that is in array of bytes or Base64?
I found out. I inserted these two lines inside the using, it can be later too: var largura = img.Width.ToString(); var altura = img.Height.ToString(); Stayed like this: var binario =…
-
2
votes1
answer704
viewsQ: How to know the dimensions of an image that is in array of bytes or Base64?
I have the following code: var binario = _documentoWord.Content.EnhMetaFileBits; string img64Bytes = ""; var base64 = Convert.ToBase64String(binario, 0, binario.Length); byte[] imageBytesBase64 =…
-
2
votes1
answer393
viewsQ: How to add an HTML element to the PDF via iTextSharp?
itextsharp allows me to add your PDF elements, example: _documento.Add(new Paragraph("Olá")); But I would like to add some elements of HTML such as a <h1>, or a <p>, how can I do?…