Posts by Guilherme Oderdenge • 2,771 points
59 posts
-
2
votes3
answers1196
viewsA: getJSON does not work
The first parameter of $.getJSON(), according to its own documentation, must be a URL. This is because the method will access your resource via an HTTP request using the GET verb. It would appear,…
jqueryanswered Guilherme Oderdenge 2,771 -
1
votes1
answer138
viewsA: How to take the 2 value of an Dice and show?
The variable must be transported from one language to another over a new request. Not only will it bother you to try to traffic this information about both languages, but this is the wrong way to do…
-
2
votes1
answer1597
viewsA: Pass parameters to modal bootstrap via javascript
The smartest solution, in my opinion, is that you make a request for each open modal. But, why, after all? Without request, you will have to store the content data you want to explode on the page…
-
2
votes2
answers955
viewsA: Change the image size according to its URL
Holder.js aims to serve images for demonstrations - it’s not a script and/or plug-in for you to crop your image based on demands. To fulfill your wish, crop an image based on a URL parameter, you…
-
6
votes2
answers25329
viewsA: The HTML page is not "calling" Javascript
Your problem: and when I load the HTML page and fill in the CPF data, nothing happens, there is no answer. Instead of function validar () {, use another scope format. In this case, validar =…
-
11
votes2
answers2611
viewsA: What are Javascript "mixins"?
Javascript mixin is a class designed with a focus on DRY. It gives the developer the ability to take shortcuts to solve problems, almost like the famous "helpers", with the difference that a mixin…
javascriptanswered Guilherme Oderdenge 2,771 -
2
votes2
answers728
viewsA: Simultaneous client side and server side requests
Imagine the following scenario: 50 users are accessing your application simultaneously. They do things there, and some of them are client requests to the server - such requests are asynchronous.…
-
3
votes5
answers4870
viewsA: Question on how to call the function with each mouse button
To listen to your buttons, use mousedown. Behold: document.getElementById('workspace').addEventListener('mousedown', function (event) { event.preventDefault(); if(3 === event.which) alert('right…
javascriptanswered Guilherme Oderdenge 2,771 -
6
votes2
answers2443
viewsA: How to print a web page using the backend Rails?
You can use the library html2canvas to save an image. I have prepared the following demo for you: HTML: <div id="welcome"> <h1>Hello world!</h1> </div> <hr> <div…
-
2
votes3
answers262
viewsA: A column in several rows
There are two columns with 8 and 4 spaces respectively, totaling 12 - the natural maximum for Bootstrap 3. Inside the first column of 8 spaces, we will have another two with 6, totaling also 12.…
-
1
votes1
answer63
viewsA: Handlebars Compile Function with options Parameters
Before we think about compiling Handlebars, think about minifying HTML. Okay, but what about Handlebars' properties, how do they look? In fact, it’s time to link useful to pleasant: use a minifier…
-
14
votes2
answers8746
viewsA: Is Javascript interpreted or compiled at runtime?
V8 and Rhino are examples of Javascript compilers. Respectively, for internal native code (C++) and for Bytecode JAVA. There are also other interpreters that use a JIT compiler. To the letter,…
-
1
votes1
answer263
viewsA: Problem with two clicks - Javascript function
Everything works well, however, the conditional flow seems to me out of the logic you want. In the following fragment, you check whether the width of el is 360px: if (el.style.width === "360px") { }…
javascriptanswered Guilherme Oderdenge 2,771 -
14
votes3
answers516
viewsA: Client router vs server router?
Routes are behavioral triggers. When you access http://seusite.com/contato/, the idea is to display a page for contacts. The router, in this case, is responsible for "explain" to the application…
-
5
votes1
answer577
viewsA: Reactjs and routes
Within an MVC structure, React.js would be the "V" of architecture. In other words, it is only and only the vision. If you access the official website, there is a fragment of explanation intended…
-
3
votes1
answer422
viewsA: Like getting X and Y points on a Div?
I have prepared a more flexible solution for you, based on the comments and without the need for any Javascript. HTML: <div id="wrapper"> <div id="elements"> <div…
-
1
votes1
answer88
viewsA: Javascript can not find page in Aspx
You’re making a GET type HTTP request, which means specifying a file path is illegal and won’t work. Therefore, its function is loadXMLDoc will not get another return until you specify an action.…
-
2
votes2
answers4019
viewsA: Calling Java method in Javascript
Executing some Javascript feature explicitly in a Java application is impossible. In fact, this is not restricted only to Java, but to any Server-Side language with the exception of Node.JS, that…
-
1
votes1
answer126
viewsA: Force the import of css and js on site pages
It is not possible to "inherit" this structure with pure HTML. You will need either some server-side mechanism (such as Masterpages, in C#), or, the closest you can get to the client side is using a…
-
9
votes2
answers3635
viewsA: What is metaprogramming?
Imagine a man who builds cars. Sometimes he realizes he’s always doing the same thing. So he builds factories to build his cars, which is much more productive. He is now programming! Time goes by…
-
4
votes5
answers5334
viewsA: How to convert datetime to short date Brazilian model
You can use the object methods Date Javascript to do this. See: var data = { date: "2014-06-16 21:56:29" }; var date = new Date(data.date), day = date.getDate(), month = date.getMonth(), year =…
-
2
votes1
answer1094
viewsA: Javascript (load and setInterval)?
The problem is quite simple in fact: the use of the resource $('.postagem').emotions(); must be asynchronous. To solve your problem, every time div #atualiza is updated by the method .load(), you…
javascriptanswered Guilherme Oderdenge 2,771 -
8
votes1
answer2214
viewsA: Javascript performance: switch or if nested?
Incredible as it may seem, the else-if is the most performatic among the possible options. In this and in this benchmark, we analyze that Chrome performs better else-if almost browser version…
-
0
votes4
answers1375
viewsA: How to change the color of only one element in a form-group with several others?
You will not apply color only to the fields you want - on the contrary, you will rule out the colors of the fields you do not want. For this, you will add to the property excluded of…
-
2
votes2
answers2343
viewsA: Request Method Switching from GET to OPTIONS alone
The problem is Cross-Origin Resource Sharing. The HTTP protocol considers, as simple requests, the following methods: GET POST HEAD The others, as OPTIONS, sane Preflighted Requests. OPTIONS in…
-
1
votes1
answer737
viewsA: Accessing Rails Link Table Fields
You are creating the association table curso_cargo needlessly and almost erroneously. Rails works unanimously, where the convention is about configuration - and that only makes it necessary to use…
-
1
votes1
answer761
viewsA: What is the best way to read an XML in PHP and insert it into the Database?
Let’s look at the possibilities you’ve given yourself: Go reading TAG to TAG and inserting in BD In this format, we will have a redundant structure - with each tag read, a request is opened with the…
-
1
votes2
answers111
viewsA: Page with Horizontal Navigation
You can do this with pure CSS with ease, no need for third-party libraries. I made an example for you: HTML: <div id="content"> <div class="post"> <h1>Seja bem-vindo!</h1>…
-
1
votes2
answers1336
viewsA: Loading with Ajax
The .load() jQuery is limited. We will replace your $('#Conteudo').load(url) therefore $.ajax(): $.ajax({ url: url, beforeSend: function () { $('body').append('<div class="loader">Carregando.…
ajaxanswered Guilherme Oderdenge 2,771 -
0
votes5
answers5718
viewsA: Popup with AJAX and jQuery
Based on your question: I have an approval system and need to display a message to the user every time they click the Approve button. How can I do? I assume you’re already getting the approvals. To…
jqueryanswered Guilherme Oderdenge 2,771 -
3
votes2
answers282
viewsA: Conflict between Simple_html_dom and Nonobject-Oriented functions
Move the connection up the include_once() not to disrespect the file code - this is probably affecting the workflow class simple_html_dom. Upshot: function crawler() { $conecta =…
-
1
votes2
answers121
viewsA: Ruby and Ruby on Rails version - Openshift
I’ll answer back and forth. You ask: Is an application made in Ruby 2 compatible with Ruby 1.9? What versions are supported by Openshift? So according to her own ruby-lang.org: Compatibility We have…
-
3
votes2
answers2780
viewsA: Log into the Nfe portal with Curl and PHP
If the session is expiring, then there are probably more parameters to be passed to: http://www.nfe.fazenda.gov.br/portal/consultaCompleta.aspx?tipoConteudo=XbSeqxE8pl8= Use some Debugger to check…
-
6
votes5
answers5718
viewsA: Popup with AJAX and jQuery
This is your need: I need to open a popup with my database information, when clicking a certain item on a grid that I am displaying on the screen. [...] — Sirsmart, 7 May 2014 So I’m gonna supply…
jqueryanswered Guilherme Oderdenge 2,771 -
8
votes4
answers9073
viewsA: What is the difference between using . js and .min.js files?
Archives .min come from the English minified, which, in literal translation, means minificado, or, less technically and more colloquially, compactado. These file types often have their variables and…
-
4
votes1
answer10006
viewsA: Sort the latest registrations according to the registration date
Use the clause ORDER BY in your query for this, this way: SELECT id FROM table ORDER BY date DESC Where: id = given to be returned; table = table to be consulted; data = date of registration in the…
-
1
votes1
answer88
viewsA: How to remotely recover text from PHP messages in jquery.validate
You nay need to do server-side validations. To simplify, there is no need to have it on the server side because it does not work with the presentation. If you do so, you will enter a conceptual…
-
8
votes3
answers19104
viewsA: Understanding threads in C#
You spoke of "asynchronous". Let me ask you: you know the technical difference of an asynchronous process to a synchronous process? Basically, the synchronous process happens with competition; the…
-
3
votes1
answer126
viewsA: Replace Webforms with MVC
No, there’s no tool for that. The largest - and virtually single - layer to be changed to do this portability is the presentation - on MVC, the famous "view" - and there is nothing that will…
webformsanswered Guilherme Oderdenge 2,771 -
10
votes2
answers7394
viewsA: Entity Framework update and delete associative entity
That question, beforehand, is conceptual and has no relation to the Entity Framework itself. About your doubt, you must think how Aluno and Curso: courses exist without students and students exist…
-
6
votes2
answers257
viewsA: Asynctask x Multithreading
If it is a simple¹ JSON file, use Asynctask. Asynctask is most useful for asynchronous operations (d'oh) with low data demand; on the other hand, however, the Java Threads are relevant when dealing…
-
6
votes1
answer1105
viewsA: Run function when clicking on "textarea"
To detect if a text field (textarea) was clicked, with Javascript pure and unobtrusive, you can do: HTML: <textarea id="message"></textarea> Javascript: function $(id) { return…
javascriptanswered Guilherme Oderdenge 2,771 -
1
votes2
answers198
viewsA: 'Undefined offset PHP' in a "for" loop
You have a array in his for - This won’t work. Try this: for($i = 0; $i <= $file; $i++) { // o seu código aqui } If not, let’s think: you have a condition $file->isDir(), which means that…
phpanswered Guilherme Oderdenge 2,771 -
5
votes3
answers176
viewsA: Login system
1. Changing the database adapter (recommended) You should use PDO or Mysqli instead of mysql. 2. Handling of $_POST content (recommended) Never pass magical request variables ($_POST, $_GET, etc)…
-
2
votes2
answers117
viewsA: Doubt object orientation + java ORM
Endereço, Contato and Acesso are classes? Because if yes, very likely we have a small problem here. Yes, small, ironless. That information is aggregated à um user - they belong to it and are…
-
3
votes1
answer1536
viewsA: Is it possible to create a remote server with Mongodb? How?
Disregarding the issues of firewall and security, the logic for the remote connection of a Mongodb to a Mysql, for example, is the same. In your terminal, in turn, you will use the following…
-
2
votes1
answer206
viewsA: Load javascript file together with Infinite scroll
Logically: When scrolling the page -> executes funcao(); when to run funcao() -> does what you want. Try to imagine that the coupler looks like a hover or click, but it would, this time, be…
-
1
votes1
answer100
viewsA: What causes this mistake?
Boy, the problem is exactly what’s being shown: The [errors.message] view was not found. Try to confirm if it really exists.
laravelanswered Guilherme Oderdenge 2,771 -
3
votes2
answers3617
viewsA: My javascript function does not call controller action
When you submit the form, you should call the function loginUsuario(). You are doing this? Put this after function implementation loginUsuario(): $('form').on('submit', function(e) {…
-
2
votes6
answers11947
viewsA: How to create a password reset link?
These links have tokens for each recovery request and/or password change. For each password recovery request, you should follow the following flow: Create a token and store it in the database…