Posts by Gabriel Rodrigues • 15,969 points
440 posts
-
1
votes2
answers651
viewsQ: Get the correct Index without duplicating the Select Option
I need to create a select with the days of the week, and upload them when they are already in the database, then I receive in my index the id of the day of the week and I have to leave it as…
-
4
votes2
answers635
viewsQ: What’s the difference from ON to ONE in Jquery
I’m dealing with some current optimizations on my system and I found a situation that intrigued me,every time I double-clicked the table and called a function to bring the client’s complementary…
-
1
votes1
answer1231
viewsA: Changing overflow-y:scroll style
Define styles for scrollbar is a rarity, they are not part of the W3C standard for css, and therefore, most browsers simply ignore. But there are Webkits that allow customization, in my tests I…
cssanswered Gabriel Rodrigues 15,969 -
5
votes2
answers1680
viewsA: Bookmark
Hendy Tarnando created an example of how to add bookmarks, it is compatible with all browsers, example: $('#bookmark-this').click(function(e) { var bookmarkURL = window.location.href; var…
javascriptanswered Gabriel Rodrigues 15,969 -
2
votes1
answer169
viewsA: How to safely upgrade Cakephp from version 0.2.9 to the latest version
Unfortunately there is no migration guide for version 0.2.9 available on the cakephp in addition it is possible that you have to modify a lot knowing that there have been migrations from 1.2 to 1.3…
-
6
votes5
answers51834
viewsA: In Javascript, how to verify that an object is empty (without jQuery)?
Following the same logic of the implementation of jquery in the version v1.11.3 you can check if it’s empty like this: var objetoVazio = {}; var objetoContemValor = { "key": "valor" }; function…
-
0
votes2
answers149
viewsA: How to take more than one bank category from the same table
You can create an array with categories and select them, for example: SELECT * FROM filme WHERE categoria = IN ('acao','aventura') ORDER BY nome LIMIT 10 As I don’t know how you are selecting more…
-
2
votes4
answers835
viewsA: Load page with Jquery event
It was a little confusing your explanation, but it would be when the radio is checked perform an action? can be done this way: if ($("#mycheckbox").prop("checked")) { alert("Execute uma ação"); }…
-
2
votes2
answers2558
viewsA: How to force download via remote url to any File type
You can try something like: <?php $file_name = 'mov_bbb.mp4'; $file_url = 'http://www.w3schools.com/html/' . $file_name; header('Content-Type: application/octet-stream');…
phpanswered Gabriel Rodrigues 15,969 -
1
votes1
answer1077
viewsA: Make all javascript read utf-8 or iso-8859-1 character
we usually define in tag meta of the site : <meta charset="utf-8"> but I think you can do something like: <script type="text/javascript" src="[path]/lang.js"…
javascriptanswered Gabriel Rodrigues 15,969 -
4
votes1
answer212
viewsA: How to know if an Image View already has an image?
UIImage *imagem = [[UIImage alloc] init]; if (imagem.image != nil) // imagem existe else // imagem não existe
iosanswered Gabriel Rodrigues 15,969 -
13
votes6
answers10207
viewsQ: Open Multiple Bootstrap Modals
As per bootstrap documentation: Modal Multiple modes are not supported and require additional code. I am trying to open various modals within others, these modals are called external files with…
-
2
votes3
answers5917
viewsA: Check whether the values of an array are all the same or all different
Array.prototype.allValuesSame = function() { for (var i = 1; i < this.length; i++) { if (this[i] !== this[0]) return false; } …
-
1
votes3
answers644
viewsA: Hide html img tag
You can use the function file_exists to check if the image path is valid, if the same means that the image exists, if it does not exist you do not need to show it on the example screen: if…
phpanswered Gabriel Rodrigues 15,969 -
2
votes2
answers1075
viewsA: How to apply style only to modal (Bootstrap)
If you own more than one modal and rewrite the css using ! Important all the modals of the page will be motified. a more assertive approach would be to create your own css configuration and add the…
-
4
votes2
answers3753
viewsA: Check if the login exists in jQuery before submitting the form
An interesting way to do this is to fill in the field e-mail you use the method change jQuery to send an Ajax. In PHP he will make a select checking whether this email exists in the database, and if…
-
4
votes1
answer12576
viewsA: Change the image src
If you change src and what you need you can use example 1, if you change the selector to example 2 and create dynamically example 3. // 1 Para mudar o caminho da imagem var id = 3; var test =…
-
0
votes2
answers124
viewsA: Login system (error when banned)
You can take the return of mysql and find the ban and make a if checking if he is banned to perform an action. if($row[0]['ban'] === '1'){ echo 'usuário está banido e não pode logar.'; }…
-
1
votes3
answers311
viewsA: How to use a different logo if the pattern does not exist?
The @Renan response on Multiple backgrounds could solve my problem, but in uploads of images with background transparent images end up blending. In the OS response: Fallback image and timeout -…
-
3
votes4
answers3696
viewsA: Multiple Bootstrap Alerts
I was able to solve this question by creating a function that receives the example alert sucesso,atencao,erro and the texto and give a append in a div I created ex: resposta, the function is in…
-
1
votes3
answers1636
viewsA: Download Counter
An interesting solution and use files .txt to store this record since it is not such a necessary thing to have in the database. Example: Create a file called download.php with the following content:…
-
4
votes4
answers3696
viewsQ: Multiple Bootstrap Alerts
I’m trying to create a standard response using the alerts do bootstrap, my goal with a simple: $(".alert").addClass('alert-success').text('Configurações salvas com sucesso.'); I choose the class…
-
2
votes2
answers184
viewsA: How can I sort by line size in Sublime Text?
There is a plugin that you can add to sublime-text: Sortby - Github
sublime-textanswered Gabriel Rodrigues 15,969 -
4
votes3
answers6401
viewsA: Configure Phpmailer with Hotmail
1° Check that the openssl php module is enabled, phpmailer needs it 2° If Gmail,Hotmail,Yahoo use port 587. Example of a Service I use: date_default_timezone_set('Etc/UTC'); require…
-
1
votes1
answer1941
viewsA: Button change the status
// Array Json exemplo de retorno do php var myArray = [{ "nome": "Gabriel", "senha": "123", "ativo": "Ativado" }, { "nome": "Rodrigues", "senha": "1234", "ativo": "Desativado" }, { "nome":…
-
1
votes1
answer703
viewsA: Change the size of the button
In version 1.4.5 of jquery Mobile this feature works natively in the framework, see: <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script…
-
1
votes4
answers791
viewsA: Taking data via ajax
$("#menu li a").click(function() { var resposta = $(this).attr('href'); alert(resposta); }); <script…
-
2
votes1
answer566
viewsA: Improve table header view using bootstrap 3.0.0, datatables and fixedHeader
Marcelo, You can use the offsetTop to do this, example: var oTable = $('#example').dataTable({ "paging": false, "info": false }); new $.fn.dataTable.FixedHeader(oTable, { "offsetTop": 50 }); Working…
twitter-bootstrapanswered Gabriel Rodrigues 15,969 -
5
votes1
answer95
viewsQ: Closure Compiler JS - CSS Transform into a Bulk Process
Google has two tools for compilar/minificar optimizing the files JS and CSS, Closure Compiler JS and Closure Compiler CSS. To perform the compilation process I can do as follows: java -jar…
-
2
votes1
answer311
viewsA: wysiwyg won’t let you type
Renan, you must follow an order in the assembly of your html to load the components correctly, 1° download the jQuery: Download And the first to be included, why bootstrap,font-awesome e summernote…
-
0
votes2
answers1955
viewsA: Adding numbers from an array
you can use the array_sum example: In the PHP: $array = array(150,500,460,100,-290,100, 295,120,180,600,700,100,1200,100,200,100,600,-120); echo array_sum($array); /*retorna a soma do array. se você…
-
1
votes5
answers169
viewsA: What is the fastest is_null($y) or $y == null?
There’s no difference between is_null and === null. The unifies difference and that is_null is a function and consequently, 1° The call of the function slows it down, but this speaks of a relatively…
phpanswered Gabriel Rodrigues 15,969 -
0
votes4
answers3842
viewsA: Link in tr of table
So it gets simple and works without using js. $link = "https://google.com"; $link2 = "http://youtube.com"; echo " <tr>"; echo " <td><a href='$link'> Google</a> </td>";…
-
12
votes2
answers2820
viewsQ: What’s the difference between @import of css and html Link?
I created a file containing css that are used in my system. I wonder what is the difference between calling css by link or by @import thus: /* ou dentro do codEventos.css */ @import "../padrao.css";…
-
0
votes2
answers198
viewsA: Button with link to a website
The function for this is the openURL, an example: @IBAction func WebLink(sender: AnyObject) { if let url = NSURL(string: "http://...") { UIApplication.sharedApplication().openURL(url) } }…
-
3
votes3
answers1139
viewsA: Organize alphabetically with indicative header, json
If you give a console.log(i) will see that you are going through the indices in the wrong way, the output show 0,1,each instead of 0,1, I made an adaptation of my initial solution to solve this…
-
2
votes1
answer64
viewsA: Script Problem with PHP Checking Session
So it works cool, tip, try to keep your javascript in a separate php file. <?php session_start(); function verifLog() { if (isset($_SESSION['user'])) { header('Location: logOn.php'); } else {…
-
1
votes2
answers499
viewsA: How to make this MENU with CSS
I created here, now you need to change the menu color and put a logo, I believe this example gives you a good idea JSFIDDLE nav { background-color: #dddddd; padding-left: 5em; } ul {…
-
3
votes1
answer50
viewsA: How to get variable from an HTML form?
A simple way of doing and creating a session and putting the user in it. example : session_start(); $_SESSION_['user'] = $user; // no outro arquivo você chama $_SESSION_['user'] another way too and…
-
0
votes2
answers83
viewsA: Display None helps resolve slowness on an onepage site?
Felipe, Imagine a painting. You have a white background and start drawing an apple with a lot of detail for an hour and then you completely cover with another layer of white paint. This is the…
-
0
votes1
answer532
viewsA: Error generating PDF with mPDF
@Michel, this message can be caused by several things, here are some ways to find your problem and how to facilitate the mounting of your pdf. 1° Remove your html and leave only one hello world. If…
-
3
votes2
answers23894
viewsA: Unable to locate driver (Pdoexception "could not find driver")
Check if you are with enabled drive you can do so: foreach(PDO::getAvailableDrivers() as $driver) { echo $driver; } If there is no drive enable in your php.ini the following extensions:…
-
0
votes2
answers54
viewsA: Apply css to form only in one domain
You can write your own css and check when it is pt, if it is you can add the class of css that you created, example: var isPt = true; if(isPt){ $('#nome').addClass('nomePt'); }else{…
-
0
votes2
answers4960
viewsA: Add Header and Footer to all pages
You could do this with jQuery. Put this code on index.html <html> <head> <title></title> <script src="//code.jquery.com/jquery-1.10.2.js"></script> <script>…
-
0
votes1
answer110
viewsA: Pattern design for Webapi project
You can use the Slim Framework it is a micro framework developed in php. Example of use: $app = new \Slim\Slim(); $app->get('/hello/:name', function ($name) { echo "Hello, $name"; });…
-
0
votes1
answer75
viewsA: Sending email by localhost
Create a php file called test for example and include the class PHPMailerAutoload.php and configure the sample parameters: date_default_timezone_set('Etc/UTC'); require 'PHPMailerAutoload.php';…
-
1
votes1
answer203
viewsQ: How to modify the view path with htaccess
I’m creating a htaccess to redirect the URL, for example: I have the following URL: www.site.com.br/view/html/cliente.html www.site.com.br/view/html/relatorio/demonstrativoDeDebito.html and I’d like…
htaccessasked Gabriel Rodrigues 15,969 -
0
votes1
answer51
viewsA: Javascript rotatory iframe
I used jquery to load in iframe see: function randomIframe(obj){ var ends = new Array(); ends[0] = "http://www.terra.com.br"; ends[1] = "http://www.uol.com.br"; ends[2] = "http://www.bol.com.br";…
-
1
votes1
answer256
viewsA: Save value in variable
See this example on JSFIDDLE I found here Stackoverflow - Sortable Change Event element position put a console.log(pos); that shows you the return with beginning and end of each movement. var…
-
1
votes4
answers607
viewsA: Get full number of an input
in jQuery you can do so: var valor = $('input').val(); $('div').append(valor); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <input…