Posts by Paulo Roberto Rosa • 8,979 points
159 posts
-
2
votes3
answers8971
viewsA: Go to the next element with next and add a class to the previous one
You can yes, using the .next() of jquery and also the .prev() however you will need to check if there is a next/previous element before leaving doing what you have to do, and also changed some…
-
4
votes3
answers4195
viewsQ: How to insert an element between two elements?
Explanation: I have a <div> parent containing two <div> daughters, however I would like to insert a <table> using javascript, between, that is, in the middle of these two…
-
76
votes12
answers208289
viewsA: How to format date in Javascript?
You can use a function to do so in order to simplify your work: function dataAtualFormatada(){ var data = new Date(), dia = data.getDate().toString(), diaF = (dia.length == 1) ? '0'+dia : dia, mes =…
-
2
votes1
answer243
viewsA: Cookies for intelligent search in E-commerce
Cookies would not be required. You can mount the url with parameters via javascript, and in the event onLoad from the other page you would check the value of the parameter and perform the search…
-
2
votes2
answers1416
viewsA: How to subtract decimal numbers?
You can use Math.floor() to round down to obtain the 0 that you want: But you want the decimal value, so you should only use fewer decimal places, because javascript is no longer needed after a few…
javascriptanswered Paulo Roberto Rosa 8,979 -
5
votes2
answers5722
viewsA: How does it work to adapt to different resolutions on Android?
Answer: Adaptation to different resolutions of the android consists of: Values for a LinearLayout that would be the Pesos(android:layout_weight). Explanation: You can assign the property…
-
12
votes3
answers973
viewsA: Scroll navigation in Bullets
You can add a class .active to their bullets when executing the event you have by clicking them(onClick), but you have to remove the class .active of all of them too, so that they don’t all get…
-
2
votes3
answers9879
viewsA: How to free all memory allocated by an object - Delphi
You can use the following function that frees the memory and Zera the object, which would be the following function: procedure FreeMemAndNil(var ptr; size: Integer = -1); var p: Pointer; begin p :=…
-
1
votes2
answers226
viewsA: Error performing Insert on an Android application: "Empty bindArgs"
I found the mistake. Explanation: It would be because I was using the function .execSQL() sending two parameters instead of one and sending null in the second just as I was doing in the .rawQuery()…
-
3
votes2
answers226
viewsQ: Error performing Insert on an Android application: "Empty bindArgs"
Explanation: I have an android app that was made using the ADT (Android Developer Tools) I use the bench sqlite and eventually perform some operations such as insert or update and also some…
-
2
votes3
answers27173
viewsA: How do I do an entire division?
Javascript automatically already divides giving a decimal result, but you can convert the decimal result to Inteiro so that you have the result you want. Examples: Decimally(default): 3/2; => 1.5…
javascriptanswered Paulo Roberto Rosa 8,979 -
2
votes4
answers9017
viewsA: How to declare a constant in Javascript?
No variable is always constant in javascript, but you can do the following: var NUMERO_MAGICO = 3; About the int javascript automatically assigns typing according to the value received in the…
javascriptanswered Paulo Roberto Rosa 8,979 -
32
votes2
answers15929
viewsA: How to transform numeric digits into numbers in full?
Javascript does not have a native function to perform this process. However, you can use this function to return an extended number: //+ Carlos R. L. Rodrigues //@…
javascriptanswered Paulo Roberto Rosa 8,979 -
4
votes2
answers5558
viewsA: Is there any way to disable Delphi’s "Debugger Exception Notification"?
Answer: Yes, there’s a way to disable it. Explanation: Delphi 7 - In the top menu, click Tools-Debugger Options open a window, navigate to the tab Language Exceptions and you’ll see a checkbox…
-
9
votes7
answers3042
viewsA: Hide input value
Answer: You don’t need anything you’re doing, you can just use the attribute placeholder of <input> in this way: <input type="text" class="pesquisa-class" placeholder="Digite o produto…
-
6
votes3
answers331
viewsQ: Unknown cause error: "Syntaxerror: invalid range in Character class"
Situation: I have a page that contains a <iframe> another, on this other page, I have a simple HTML element input: <input type="text" required="" pattern="[a-Z]{2,35}" tabindex="6"…
-
1
votes3
answers4097
viewsA: How to randomly color Divs with a Javascript Color Array?
Answer: You can randomize a hexadecimal color using Math.floor() and Math.random() in this way: var corRandom = '#'+Math.floor(Math.random()*16777215).toString(16); Explanation: A hexadecimal color…
-
0
votes4
answers27486
viewsA: How to change the background with javascript?
Answer: You have 3 options, of which they are: (1) - You can change the color of the text by applying a CSS style to your element <span> which would be for example: #date_time { color: #FFF;…
-
8
votes5
answers21918
viewsA: How to replace the <img src> of a small image with a large image?
Answer: First, you must generate the path of your images dynamically, so it is easy to change them dynamically as well. Explanation: You can generate the path of your images automatically this way…
-
3
votes2
answers439
viewsA: Jquery - Problem with events Mouseenter() & Mouseleave()
Answer: Your problem is that the animations don’t have enough time to finish before you start another. Solution: You can use the event .stop() in order to stop propagation of the animation before…
-
4
votes4
answers482
viewsA: Disabled button modified using firebug
Answer: You can’t do anything about HTML, against someone who opens the firebug and comes out modifying things. Explanation: You can only have security if you validate on the Server, because any…
-
9
votes2
answers29287
viewsA: Take JSON data array and print with jQuery
If you want, I recommend using a JSON Parser to easily create and modify JSON’s like this one: JSON Parser Online To create a Array in json organized by states use your object as follows: {…
-
1
votes4
answers3127
viewsA: How to prevent the input-text focus from being lost by clicking on another element?
Answer: There’s no way avoid this. By default browser behavior, if you click on something else, your focus is lost, however you can return the focus using jquery in this way: $('sua_tabela…
-
1
votes1
answer117
viewsA: Form Receive in 2 different tables
Problem occurs because there is already an id 0 as primary key in your table, so it does not allow you to enter another equal, because primary keys cannot be duplicated, to solve you would have to…
-
3
votes3
answers221
viewsA: Equivalent to jQuery’s . filter() method or Zepto in pure javascript
Explanation: Using pure Javascript you would have to go through in your Document all the elements that have the tag <p> using the function document.getElementsByTagName(), and then store them…
javascriptanswered Paulo Roberto Rosa 8,979 -
8
votes1
answer1524
viewsA: How to change mouse cursor icon when passing over link?
Navigate to your events tab DBGrid and double click on OnMouseMove. Delphi will automatically create the event, you will check the coordinate X which would be the horizontal so would be the column,…
-
10
votes4
answers6297
viewsA: Form inserting twice in the bank (F5)
By default, the F5 updates your page, and if you just submit form information, it will normally ask for a confirmation: It is normal that if you click resubmit the same information is sent again, it…
-
2
votes2
answers2746
viewsA: How to make the jQuery toggle function in pure javascript?
in Jquery would be this: $('body').toggle( function(){ alert('A') }, function(){ alert('B') }, function(){ alert('C') }, function(){ alert('D') } ); That is, several functions assigned to the body…
-
6
votes1
answer1992
viewsQ: How to schedule an event in Javascript?
Information: I would like to know how to accomplish a Agendamento of an event, that is a function that I would pass as a parameter, that would perform such a dia/mês/ano such hora:minuto that I…
-
9
votes1
answer1992
viewsA: How to schedule an event in Javascript?
Well, you can do the following, from what I understand you want like a Scheduler which would be like a schedule to perform a certain function. I made it so that you can inform the interval too, to…
-
5
votes2
answers4586
viewsA: How to create an AVD for Android in Delphi
You need to use the AVD Manager which is a Google app that you find in conjunction with the ADT Bundle which is a set of apps used to manage and use Android. Here you can download the ADT Bundle.…
-
19
votes8
answers5453
viewsA: Why in some if’s situations are considered bad?
Look, there’s no kind of Rule or Pattern to these things, but stopping to think, you can identify the best method to program, as @Igorcarvalho said, this is "feeling" IE, it’s like a feeling, that…
-
4
votes3
answers255
viewsA: How to clear the cache in Opera 12?
Squeeze Ctrl + F12 and you will have a menu of Preferências, navigate to the tab Avançado and in the menu on the left select Histórico soon after you will see a button Esvaziar Agora click on it and…
-
2
votes2
answers2633
viewsA: Input type date, how to format output
Use the Plugin jqMask To use it just include the file jqmask.js on your page and then use it as follows: $('#ID_Do_Seu_Input').('99/99/9999');…
-
4
votes4
answers44310
viewsA: Remove page element with javascript
It’s simple: document.getElementById('conteudo').remove()
javascriptanswered Paulo Roberto Rosa 8,979 -
0
votes2
answers4360
viewsA: How to fix column in table accessible?
Would this be? HTML: <table width=200 height=200 frameborder=1> <tr class="fixed"> <td>a</td> <td>b</td> </tr> <tr class="fixed">…
-
0
votes2
answers732
viewsA: How to select one or more items in the jQuery UI Multiselect plugin?
It’s very difficult to understand your question, but from what I understand you could do it: First, add classes to your groups, and define events in buttons such as, let’s suppose: <button…
-
6
votes8
answers4914
viewsA: Do not allow saving image of a web page
You can block the "Right Click" of the mouse on your page, but this is not recommended, because you will lose all the other features that the right button has. Even so, there is a way to do, if you…
-
1
votes4
answers1175
viewsA: Function to expand list
Wrap the list of letters you have in a <div> apply an id to it, (I created two buttons to illustrate, one to show another to hide): <button onclick=mostraTodasLetras(true)>Mostrar…
-
7
votes1
answer353
viewsQ: Why am I losing the values of <input> when opening and closing a <iframe> using Javascript?
Context: I have an application, which uses php+html+css+javascript(with jquery). On it I have a page called principal.php containing an iframe: <iframe src=pedido.php/> inside calling the…
-
14
votes2
answers8665
viewsQ: How to clone an element in Javascript?
Is it possible to obtain an exact clone of a given HTML element? so that the clone contains all properties exactly the same? If there is, I would like to know how to proceed to perform this clone,…
-
11
votes2
answers8665
viewsA: How to clone an element in Javascript?
Answering the question: Yes, there is a possibility of getting a clone, using native javascript, which would be, or not (you’ll already know why) a faithful clone exactly the same containing all the…
-
37
votes6
answers47964
viewsA: What is JSON? What is it for and how does it work?
Concept: JSON, in its theoretical meaning is "Javascript Object Notation", of which nothing else is that the lightest format known to me of data transfer/exchange, it is similar to the XML, and has…
-
17
votes7
answers43303
viewsA: How do I know if a variable is of the Javascript Number type?
It is simple to know if a variable is Numero or not because there is a native Javascript operator that says the type of its variable, which would be the operator typeof, there are some types of…
-
20
votes7
answers43303
viewsQ: How do I know if a variable is of the Javascript Number type?
In javascript, because there is no declaration of the types of variables such as Integer, String, Boolean, etc., it is a difficult task to know what kind of value you are dealing with in a given…
-
4
votes2
answers180
viewsQ: Is there a plugin or CSS code generator for Shapes(Shapes)?
I wonder if there is a method of creating Shapes(Shapes) using CSS, which I don’t need to keep creating and adjusting everything in hand from scratch, until I can create the form I want. Is there…
cssasked Paulo Roberto Rosa 8,979 -
0
votes2
answers250
viewsA: Spacing between Ivs overlaps
I believe the spacing you’re talking about is the property padding CSS, so with this CSS code, you will have the correct spacing, however the correct would be to learn how to make the change…
-
4
votes2
answers549
viewsA: Import events in Google JSON format
You just need to tell Google Calendar that you want a JSON, passing it as a parameter, and to rescue JSON, use the function file_get_contents() of PHP. $json =…
-
2
votes8
answers48548
viewsA: How to pass parameters in function calls by reference in Javascript?
The way you’re doing, that’s using a Closure(as I told you in the previous question) you are passing a reference from a function to the argument, which is expected. However, you can use parameters…
-
2
votes3
answers1664
viewsQ: How to use a Cookie as an Array in Javascript?
Doubt: I would like to know a way to use a Cookie, as if it were a Array. Problem: I can’t imagine how to do that. Example: Suppose I have one Array called Foo which would be as follows: var Foo =…