Posts by Oeslei • 5,209 points
127 posts
-
9
votes1
answer261
viewsA: Reverse results of while
You can store the result in an array and invert it later: $arrUrls = array(); while($noticia) { if (url_exists($url = 'http://www.exemplo.com.br/noticia_'.$noticia.'.htm')) { $arrUrls[] = $url;…
-
6
votes2
answers8864
viewsA: Formatting date field with jQuery Masked Input
What happens is that you do not receive the jQuery object in the variable $, because its value is coming as a parameter by the function and not directly from the object window as usual. Using jQuery…
-
1
votes3
answers8700
viewsA: Tag <a href> without changing the location bar
There are two possibilities for the tag a do not change the current url. <a href="#" onclick="return false;">...</a> <a href="javascript:void(0);">...</a> One easier solution…
-
2
votes2
answers1713
viewsA: HTML5 tables - subdivide column
You must use the colspan merging 2 or more columns: <div> <table border="1px"> <thead> <tr> <th>Fase</th> <th>Descricão</th> <th…
-
1
votes1
answer163
viewsA: min-height, doesn’t work on mobile what do I do?
The problem is that you have a condition for medias of the type screen, that mobile is not a part of. Remove this condition, leaving this way: @media (max-width:320px) { .banner ul li {…
-
1
votes2
answers623
views -
3
votes4
answers2296
viewsA: How to order three Ivs according to an attribute of hers?
You can do the following: Get all attribute values from Divs count; Sort the array; Adjust the order on the screen. The script would look like this: var $pai = $("#pai"); var arrProdutos = [];…
-
1
votes1
answer65
viewsA: Is there any way to "summarize" elseif’s?
From what I can see, the conditions change only the value of conditions. So you can set it separately this way: $conditions = array(); if ($cliente_id != null) $conditions["Client.id"] =…
-
1
votes5
answers206
viewsA: Problems sending many variables through _GET
You could do something like this: // coloque todos os valores necessários no array $arr = array( 'v2' => 'nomeFantasia', 'v3' => 'cnpj' ); // percorre o array foreach ($arr as $get =>…
-
3
votes4
answers428
viewsA: Make SELECT return data in default language when no translation can be found
You can use a ORDER BY and LIMIT 1, as in the example below: ORDER BY FIELD(idioma, 'en-us', 'pt-br'), idioma LIMIT 1 In the function values FIELD you put first the language you are searching for…
-
1
votes2
answers158
viewsA: problem with regular expressions in php
Try using the flag s or m. Would that be: preg_match_all('/expressao/s', ...). The flag s serves to consider all characters when using the ., including newlines (which are not considered by…
-
0
votes4
answers529
viewsA: How to generate an array with the list of uploaded files?
You can generate the array the way you showed it yourself: $meuArray = array($nome1, $nome2, $nome3); Another way to set the values, which can also be used in a looping is like this: $nome1 = "nome…
-
1
votes1
answer527
viewsA: jQuery multiple word autocomplete
You can add a filter to the function that provides the source: source: function( request, response ) { // verifica se a pesquisa não está vazia if ( extractLast( request.term ) ) { response(…
-
1
votes2
answers108
viewsA: Comment area overlapping the footer of the site!
Maybe the problem is with some float in the chat container. Try using the style clear: both in some element right after the chat, but that is inside the container. Also check that the container has…
-
6
votes2
answers189
viewsA: limit the for, php
You can do it this way: $qtdPag = 20; $pg = 10; $dottedBefore = false; $dottedAfter = false; if ($qtdPag > 1 && $pg <= $qtdPag) { for ($i = 1; $i <= $qtdPag; $i++) { if ($i == $pg)…
-
6
votes2
answers225
viewsA: How do I get the files pulled from the root of the site?
A legal way is to have a constant defined having the root path of the site. For example: define("SITE", "http://menusite.com.br/"); The pictures would look like this: <img src="<?= SITE…
-
4
votes4
answers798
viewsA: Filter <td> with PHP
If I understand what you want to do, you can use a regular expression to capture the tags td that would be so /<td>(.*?)<\/td>/. Note that if there are more tables in this string the…
-
2
votes2
answers1259
viewsA: "Floating" sidebar inside an element when scrolling
One of the features of Bootstrap does just what you want, the affix. the only requirement is to add a style position: absolute to the element you want to fix and run a JS code to initialize the…
-
1
votes1
answer115
viewsA: Browser only responsive HTML page
The problem is in the condition of your @media queries. You put the condition only screen, IE, your mobile will disregard these blocks. This is why your desktop browser renders normally and on…
-
4
votes2
answers303
viewsA: Hexadecimal numbers in reverse
In Java you can do it this way: String input = "0x101c4701"; String result = ""; for (int i = input.length(); i > 3; i -= 2) { result += input.substring((i - 2), i); } System.out.println(result);…
-
1
votes1
answer95
viewsA: Problem with selecting tabs
I believe only the attribute is missing data-toggle="tab" in the sent macros tab: <li><a runat="server" href ="#enviadas" data-toggle="tab" onserverclick="Carregamacrosenviadas">Macros…
-
2
votes3
answers1590
viewsA: How to change URL objects via Javascript?
You can’t just put this code into the attribute itself href of the link? <a href="#gsc.tab=1">Pesquisar por imagens</a>
javascriptanswered Oeslei 5,209 -
2
votes3
answers118
viewsA: Media Querie is not compatible with Internet Explorer 2014
You can use the Respond.js. It is a polifyll for browsers that do not support media queries, such as IE. Just include the javascript file in your code and everything will work perfectly. =) You can…
-
1
votes2
answers306
viewsA: Do not select, dynamically, always the last li in the hierarchy
And if you did something like this? li > ul > li { background: #ff0000; } li > ul > li:first-child, li > ul > li:last-child { background: initial; }…
-
2
votes2
answers302
viewsA: How do I save the option chosen by the html user as a cookie?
You can use cookies, as already shown in the other reply, or use the Storage location, which is very simple and does not load your requests with unnecessary data. Here an excellent post on the…
-
1
votes3
answers657
viewsA: How to make the page load only after the return of getJSON?
You can use the method $.holdReady(), in this way: $.holdReady(true); $.getJSON(url, function(json) { // algum processamento com o json $.holdReady(false); }); So you can use the method .ready()…
-
9
votes1
answer391
viewsQ: Interruption of an asynchronous request
What happens when the user, for example, reloads the page with an asynchronous request in progress? Does the server continue to run the script? And how can I interrupt an ongoing request via JS?…