Posts by Joao Paulo • 11,760 points
262 posts
-
2
votes1
answer370
viewsA: How to read text from a Word document text box via C#
I figured out a way that will suit me: public static void SearchTextBox(string name, string newContent) { _documentoWord.Content.ShapeRange.Ungroup(); foreach (Word.Shape i in…
-
2
votes1
answer370
viewsQ: How to read text from a Word document text box via C#
I am using Interop to manipulate a word, through an application console. using Word = Microsoft.Office.Interop.Word; I can extract the byte array, save as PDF, as image etc, but a relatively simple…
-
1
votes1
answer164
viewsA: How can I decrease HTML field values with jQuery?
For you to get the values using jQuery the syntax looks like this: var valor1 = $("#seletorUsandoIdDoSpan").text(); var valor2 = $(".seletorUsandoClasseDoSpan").text(); // caso o valor esteja em um…
jqueryanswered Joao Paulo 11,760 -
1
votes1
answer909
viewsA: load Google maps API after onload
Try it this way: $("#conteudo").load('veiculoDescarga.php', carregarMapa); function carregarMapa(){ // aqui você coloca os scripts de carregamento do mapa. }
-
3
votes3
answers1746
viewsQ: How to list a json object to generate a txt file and download that file via ajax request?
I have an ajax request that sends a large object. That in the browser console is seen like this: Object {data: Array[4936], paging: Object} Follow the request code: $.ajax({ type: "POST", url:…
-
1
votes1
answer177
viewsQ: Pre-development questions about android app with data synchronization
I would like to make a simple application to register users using java. But this app should keep a local database for offline data access and a cloud database to sync the information when I click on…
-
10
votes1
answer398
viewsQ: Doubt about mapping in Entity Framework 6. "readonly" properties
I have three tables in my bank: TB_COLABORADOR TB_JORNADA TB_JORNADA_COLABORADOR To TB_JORNADA_COLABORADOR makes the association of employees with the journey and vice versa through the fields…
-
1
votes2
answers439
viewsA: Converting values for calculation to JQ
You can do it with a line: var valorParaCalculo = parseFloat(($(".oi").val()).replace(/\./g,"").replace(/,/g,".")); // input:999.999.999,99 - output: 999999999.99 Example in the fiddle:…
-
0
votes3
answers89
viewsA: Is there a plugin that serves as a mask and validator for 24h hours?
I used jQuery-Mask-Plugin: http://igorescobar.github.io/jQuery-Mask-Plugin/ And I did the 24-hour validations I needed. It doesn’t allow 24:59:59, 23:69:59 or 23:59:69, for example. <script…
-
2
votes3
answers89
viewsQ: Is there a plugin that serves as a mask and validator for 24h hours?
I searched but only found plugins for time with "select" and schedules in formed AM/ PM. I would like one that the person could type and stay in this format: 23:59:59…
-
5
votes1
answer406
viewsQ: How to map a TIME-like column in Entity Framework 6?
I am using this mapping to a SQL Server DATETIME field: Property(X => X.DatNascimento).HasColumnName("DAT_NASCIMENTO").HasColumnType("datetime"); But I have another field that is only TIME that I…
-
2
votes2
answers3250
viewsQ: How to sort a combo select by the text of options?
I wish to sort a select combo from HTML in alphabetical order and would like help in logic to be able to assemble a function that does this regardless of the number of elements.
-
2
votes1
answer452
viewsQ: How to stop a function through the console?
I would like to stop a fadein() while running so that the screen looks exactly as it did at the time I stopped. The ideal would be something generic, that works for fadein, slideup, slideDown,…
-
5
votes1
answer52
viewsQ: Is it possible to implement null or Undefined methods?
If I wanted to implement a variable check whenever I would use the method .indexOf() javascript this would be possible? For example using a.indexOf(b); it is possible to detect when the a is null or…
javascriptasked Joao Paulo 11,760 -
2
votes1
answer478
viewsQ: Add characters before each number
I have a string in a textarea that will be in this format: 2199998888 2188889999 2455556666 2566665555 That is, phone numbers with line break to separate them within the textarea. My need is to…
-
8
votes1
answer26624
viewsA: Take class name and jquery ID
"*" looks for everything. If you don’t know the classes: var arrayObjetos = []; $(objeto).find('*').each(function(){ var classe = $(this).attr("class"); var id = $(this).attr("id"); arrayObjetos…
jqueryanswered Joao Paulo 11,760 -
3
votes2
answers399
viewsQ: Doubt about HTTP POST
I’m trying to text through a Webservice. To send a single SMS is simple. Just use the URL in this format:…
-
2
votes2
answers828
viewsQ: Select input text by its value
I would like to select an input type text field that contains the word "hi" typed in it. Assuming my input is this: <input type='text' id='texto' /> I saw that it is possible through:…
-
2
votes1
answer403
viewsQ: index with regular expression using variable
I use the index to check if a string contains a certain text. However, this is case sensitive and accents sensitive. Would there be some way for example I find these records in case to enter in the…
-
12
votes2
answers11673
viewsQ: Remove a property from an object contained in an array
I have a variable array: Bola = []; I added the properties to it: Bola[0] = { peso:0.5, cor:"branca", marca:"nike", nota:8 }; Bola[1] = { peso:0.7, cor:"verde", marca:"adidas", nota:9 }; I would…
javascriptasked Joao Paulo 11,760 -
3
votes2
answers284
viewsA: Problem with Nth-Child
Based on the comments and the response of the OS in English I had no other solution but to use jQuery: $(".visivel:even").css("background-color", "green"); $(".visivel:odd").css("background-color",…
cssanswered Joao Paulo 11,760 -
7
votes2
answers284
viewsQ: Problem with Nth-Child
I have the following scenario: HTML: <div class='linha visivel'>Visivel</div> <div class='linha visivel'>Visivel</div> <div class='linha oculto'…
cssasked Joao Paulo 11,760 -
2
votes1
answer233
viewsQ: How to take the distance from the scroll bar to the top of the page in Internet Explorer?
In the other browsers with you through the $(document).scrollTop(); But in IE it always returns 0;
-
9
votes2
answers1726
viewsQ: How to replace multiple using variable as first parameter?
When I want to replace all occurrences of a string I do so: var ola= "ola mundo ola mundo"; ola = ola.replace(/ola/g, "xxx"); Result: "xxx world xxx world"; But I want to use a variable instead of…
-
4
votes3
answers2928
viewsQ: How to replace in html string only in texts within (between) tags?
I created a search that marks the text that was found. OBS 1: The search is done in a string that is HTML. OBS 2: I check if there is text inside this HTML through the index. OBS 3: If you find one…
-
2
votes2
answers2503
viewsQ: How to search for a string inside an object in an array?
I would like to search for the word "script" within an object, which would be the variable Roteiro. I started trying to figure something out after searching the Internet, but I got lost, and it…
-
3
votes2
answers72
viewsQ: How to display alert after Eval() error?
I have a calculator that works more or less like this: [bolas][+][preco da bola] I see the string replacing [XXXXXXX] with the corresponding value and use Eval to perform the calculation. But there…
-
1
votes1
answer1281
viewsQ: How to get the url of the parent page of an iframe without being in the same domain?
I searched postMessage, but only found examples of iframe resizing. I wonder if you have any way to get the URL of the main page where my iframe is inserted using this method or some other.…
-
2
votes3
answers322
viewsQ: Put in array strings according to a regular expression
I would like to make an array containing strings in this format: [Texto com acento espaço e números 99] Example, if I have this string: var texto = "Eu quero comprar [qtdOvos] e [qtdFrutas] somando…
-
2
votes1
answer1093
viewsA: Take a div’s height and apply it to another div
I added two lines to the end of your code: $(document).ready(function() { var date = new Date(); var d = date.getDate(); var m = date.getMonth(); var y = date.getFullYear(); var events_array = [ {…
-
3
votes4
answers347
viewsQ: Is there any way to detect if there are any asynchronous calls being run?
I need to run a loop of asynchronous calls, but they cannot run simultaneously, I have to wait for the end to run another. Only I have no control over this call(It is a js function of Sharepoint…
-
2
votes1
answer825
viewsQ: How to add a class in html elements of a string?
The scenario is as follows: I dynamically assemble an html. After the html is generated it is +/- like this: var templateHtml = "<div class='bola'>Bola 1</div><div…
-
5
votes2
answers6436
viewsQ: How to call a function of another JS file keeping the context of the current function?
I have the following scenario: HTML: <script src="JS1.js"> <script src="JS2.js"> In JS1 I have the following: $(document).ready(function(){ var pagina = "site1"; iniciarSite(); }); In…
-
7
votes4
answers2296
viewsQ: How to order three Ivs according to an attribute of hers?
I have 3 Divs: <div id='pai'> <div class='produtos' contagem='2'></div> <div class='produtos' contagem='1'></div> <div class='produtos' contagem='3'></div>…
-
12
votes4
answers4731
viewsQ: How to check if the first four characters of a string match 'www.'?
What is the best way to verify this? More simply and with better performance. I could only imagine doing so: var string = "www.google.com"; if(string[0] == "w" && string[1] == "w" &&…
-
2
votes1
answer73
viewsQ: How to call a function after a slide effect?
I need to take the height of a div and redeem an ifram according to the current height, so far so good. Only I’m getting the height right after a click that gives a slideToggle in this div. And it…
-
2
votes1
answer153
viewsQ: How to discover the actions an element has when clicked?
I wonder if there is a way to create a script that shows me the actions of a certain element when clicked, or if you want to debug it in the Chrome console, for example. Something that would tell me…
-
1
votes1
answer58
viewsA: How to dynamically resize a Webpart from an app?
I found this Cross-Omain solution that allows the communication of the App iframe with the parent document. Javascript looks like this: window.Communica = window.Communica || {}; Communica.Part = {…
-
0
votes1
answer58
viewsQ: How to dynamically resize a Webpart from an app?
I created an App for Sharepoint and within the project added a Webpart. I wanted this Webpart to grow or decrease dynamically based on its content. I tried to add some codes from outside the app,…
-
4
votes3
answers144
viewsQ: How to play items with a specific value for the beginning of an array?
I have an array questions[] with the following properties: perguntas[0] = { id:1; ordem: 3; inicio: 1 }; perguntas[1] = { id:2; ordem: 2; inicio: 0 }; perguntas[2] = { id:3; ordem: 1; inicio: 1 }; I…
-
6
votes1
answer2947
viewsQ: How to get the position of a given element in a list through a specific attr?
I have a UL with some items. For example <ul class='ordemQuestoes'> <li idquestao="28" >Questao 28</li> <li idquestao="2" >Questao 2</li> <li idquestao="17"…
-
2
votes0
answers94
viewsQ: How to validate an AD user through a field using a MVC app?
I’m developing a Sharepoint MVC app that creates an AD user in Sharepoint, so I need a field similar to SharePoint:PeopleEditor that exists in ASPX, to validate these users at the time of…
-
5
votes1
answer70
viewsQ: Insert into array, whose parent property value is equal to the property value of the child object
I have an object (Questions) and I want another object (Answers) to be added to it according to a common id. var Perguntas = [ { idPergunta: 13, textoPergunta: "Qual seu nome" , Respostas : [] }, {…
-
13
votes2
answers1285
viewsQ: Ckeditor html content is empty after using jQuery-ui Sortable in your parent div
I want to leave "sortable" 2 or more div’s with a Ckeditor populated with html, but when doing this the html of Ckeditor loses the content and the editing space is blocked. Fiddle next:…
-
0
votes3
answers755
viewsA: Can you click on a <TD> and get the value of another <TD> Hide?
Use the :not(:Visible selector) var conteudoHtmlTd = $("td:not(:visible)").html(); //se quiser o html da td var conteudoTextoTd = $("td:not(:visible)").text(); //se quiser so o texto da td If you…
-
1
votes2
answers3116
viewsA: How do I keep a website page at the same point it was before updating?
One way to do it is this: Add a parameter to the form sending URL. For example the parameter ? form=1 Add an id to the form, for example #formulario. Based on these settings in php put this code: if…
-
3
votes6
answers10935
viewsA: How to receive a JSON object from an external url/domain?
Thanks to Caffé’s response, through PHP I was able to obtain the object and its values, in this way: $json = file_get_contents('http://developers.agenciaideias.com.br/loterias/lotofacil/json');…
-
6
votes6
answers10935
viewsQ: How to receive a JSON object from an external url/domain?
I found a Lottery API that brings me the data of the result of a Lotofácil draw, but I am not able to access the data of the JSON object. I’m trying this way: $(document).ready(function(){ $.get(…
-
0
votes1
answer58
viewsQ: Void Checkerror Oracle x IIS
Well, due to the exhaustion of my attempts to find the error, I’m going to try to get a light here with you. I apologize now if the error is too generic and does not have the necessary information.…
-
6
votes2
answers1160
viewsQ: How to access JSON values from ajax in a PHP page?
I passed via ajax those values: $.ajax({ url: '/loterias/cadastro.php', type: "POST", data: "{'numeros': '" + numeros + "', 'jogo':'" + jogo + "'}", dataType: 'application/json; charset=utf-8',…