Posts by Diego Vieira • 3,782 points
87 posts
-
3
votes3
answers262
viewsA: A column in several rows
To get the grid structure use this code HTML <div class="row"> <div class="col-xs-8"> <div class="row"> <div class="col-xs-6"> .col-xs-6 </div> <div…
-
4
votes2
answers2256
viewsA: Login system back to previous page in php
You can use Session to control whether the user is logged in or not, here is an example of how you could do this control. PHP class auth { public static function logged($url) {…
phpanswered Diego Vieira 3,782 -
3
votes4
answers6579
viewsA: Resize image
When I don’t want to "destroy" the image quality, I don’t use the tag img, I’d rather create a div specifying exactly the width and height without compromising the image, thus: CSS .img {…
-
1
votes1
answer77
viewsA: What features to use when creating a Chrome extension for notifications
In the documentation of Google Chrome Extensions there are plenty of examples, you may be taking a look to adapt to your project. Examples Google Chrome Extensions (English) You can use Jquery to…
google-chrome-extensionanswered Diego Vieira 3,782 -
1
votes2
answers217
viewsA: How to return the name of an existing object in a JSON
You can do it this way Jquery var json = { "uid1":{ "start_time":"20140815", "name":"name 1" }, "uid2":{ "start_time":"20141229", "name":"name 2" }, "uid3":{ "start_time":"20140809", "name":"name 3"…
-
1
votes2
answers256
viewsA: C#: Return value of a href
You can use this example to implement in your project, regular expression is used. C# private static void DumpHRefs(string inputString) { Match m; string HRefPattern =…
-
3
votes1
answer127
viewsA: How to prevent GIF images from uploading and only authorize them by clicking a button?
You can use the freezeframe for such, the other way to do is to have a static image of the animated gif, and via jQuery make the exchange of images. It would look like this using two images: Jquery…
-
0
votes4
answers193
viewsA: How to space the "fixed title" of a page and the posts?
What it looks like is that your "header" is with position fixed or absolute with top setado to 0 Anyway, that’s what I’d do CSS .header { width:100%; height:80px; background:#e1e1e1;…
-
7
votes2
answers1924
viewsA: How to pull content via AJAX from a site that has a menu header and a fixed audio player?
To change the page URL without compromising the content (refresh) just use the following code. Javascript window.history.pushState("objeto ou string", "Titulo", "/url"); DEMO of the above working…
-
4
votes1
answer85
viewsA: How to take blocks out of a grid?
You can follow the solution below or if you prefer you can use the Masonry Here is the CSS solution CSS .wrapper { width: 100%; max-width: 700px; margin: 2em auto; -moz-column-count:2;…
-
2
votes3
answers255
viewsA: Insert input only if it does not yet exist
I solved your problem as follows, although I think to solve it differently. I added to the checkbox an attibute data-add which will ensure whether the field has been inserted or not, stayed this…
-
2
votes4
answers129
viewsA: Sort H tags within a page
Question of hierarchy to tag h1 has visible power [1] bigger than the tag h2 and so on. Correct use is: h1 for title and others to indicate subtitle. The only problem of using them out of order is…
-
3
votes5
answers1347
viewsA: Singleton or class and statics?
The application for it is several, what you mentioned is another example of implementation, however the real goal of having a Singleton is to ensure that it will only be instantiated once, here is a…
pattern-designanswered Diego Vieira 3,782 -
6
votes5
answers59481
viewsA: Take content from within a Div and put in Input value
I did with Jquery for you to take a look at how to pick up the text from div Jquery $(function(){ var valorDaDiv = $(".produtosIntTitulo").text(); $("#orcamentoAssuntoForm").val(valorDaDiv); }); You…
-
2
votes1
answer361
viewsA: Configure button in Bootstrap
See on documentation that by default it is created as link Your line should stay like this: PHP <?php $this->widget('bootstrap.widgets.TbButton', array( 'buttonType' => 'button', 'type'…
-
0
votes1
answer1360
viewsA: Create a Dynamic PHP (Ratings) evaluation format
In your database you must create 2 fields, one to store the amount of votes and the other to accumulate the amount of points. As the maximum value of the note is 5, so in the following situation:…
phpanswered Diego Vieira 3,782 -
23
votes6
answers2856
viewsA: Can not use "{ }" IF keys in PHP cause problems?
In fact the IF without keys can only be used when executing a command and when it is a chain of commands you use the keys to indicate that at the instant { until the end } execute. See the examples…
-
1
votes2
answers2713
viewsA: Recover URL variable and pass on in AJAX
The correct way to send to the parameter data this is how. Jquery $.ajax({ type: "POST", url: URL, data: categoria, cache: false, success: function(html){ $('#teste').load('resposta.php'); } }); or…
-
1
votes2
answers773
viewsA: Is it possible to use two frameworks in php?
Although most Frameworks use the Pattern MVC design, it does not necessarily mean that they are written in the same way, but rather following the same line of reasoning. As you yourself mentioned,…
-
7
votes2
answers84
viewsA: Implement this
Use in this way Jquery $(document).ready(function(){ $('.nav-a').hide(); $('.categorias').mouseenter(function(){ $(this).find('.nav-a').fadeIn(); }); $('.categorias').mouseleave(function(){…
-
2
votes3
answers11103
viewsA: input type date is not filled in
Take the die and turn it into your View: View <input type="date" value="@SeuModelo.CampoData.ToString("yyyy-MM-dd")" /> Change 'Seumodelo.Campodata' to the respective of your model,…
-
4
votes1
answer407
viewsA: Test Jquery classes
I don’t know if this fully answers your question, but you can retrieve the classes as follows. Example: HTML <div id="minhaDiv" class="classe1 classe2 classe3"></div> JS var classes =…
jqueryanswered Diego Vieira 3,782 -
2
votes1
answer148
viewsA: How to use a variable script? JS
HTML <button id="open">Clique aqui</button> JAVASCRIPT function open (address) { window.open(address, '_blank'); }; var button = document.getElementById('open');…
-
1
votes4
answers430
viewsA: PHP class for interaction with Mysql BD
You can use your own MySQLi PHP $db = new mysqli("localhost", "usuario", "senha", "meubanco"); Utilizing PHP $resultado = $db->query("SELECT * FROM tabela"); while($row =…
-
1
votes1
answer1027
viewsA: When and how to use the Asp.net web api
I don’t see as much usability for this scenario that you mentioned, but yes it is possible to use. If your application is a SPA (Single Page Applications), that is, it has only one page, yes it…
-
1
votes2
answers624
viewsA: How to apply jQuery Validate rules to multiple fields at once?
You can also try this //Você coloca todos os campos que tiver, select, textarea etc.. $("#form1 input").each(function () { $(this).rules("add", { required: true }); }); Or add class="required" in…
-
1
votes2
answers4163
viewsA: How to change between texts according to time?
Can use setInterval, see an example below HTML <div class="texto"></div> Jquery $(function(){ var texto = 1; var string; setInterval(function(){ switch(texto) { case 1: string = "Meu…
-
2
votes2
answers146
viewsA: Error in mysql query in php
Yes, use Mysqli and if you can also use object-oriented, your code would look like this. $con = new mysqli(@$_SESSION['servidor'], $_SESSION['usuario'], $_SESSION['senha'], "local"); $hoje =…
-
2
votes1
answer1195
viewsA: Codeigniter: retrieve values from the out-of-loop array
What happens is that every time he loops the last value will always be stored, so doing this every time the loop runs will override the previous value. To create an array you must do as follows.…
-
7
votes1
answer9424
viewsA: How to generate a json file with new news to display on my website?
If the site is not of the same domain you will need to use this code at the top of the file. PHP header('Access-Control-Allow-Origin: *'); //Qualquer site header('Access-Control-Allow-Origin:…
-
1
votes1
answer5157
viewsA: Make div height decrease as user decrease screen
You can take a look at the event $.resize (http://api.jquery.com/resize/) jquery Here’s an example I did for you to see how it works Jquery $(function(){ $(window).resize(function(){ var winW =…
jqueryanswered Diego Vieira 3,782 -
7
votes3
answers1352
viewsA: How to transform a date into a string format without signals in Datetime?
Uses the DateTime.ParseExact There in your case would be string data = "08072013"; string hora = "1515"; data = data + hora; DateTime ParseData = DateTime.ParseExact(data, "ddMMyyyyHHmm",…
-
0
votes2
answers444
viewsA: Streaming data over HTTP in Javascript
Hello, the ideal solution for you will be asynchronous communication. In an asynchronous request, there is no synchronization between the requests, so we can send several requests in parallel, where…
-
5
votes6
answers16533
viewsA: How to mount the HTML of a "select" via PHP, using data from DB
That would be the right way to do the while to fill your select $query = $con->query("SELECT * FROM pv_tipo_info_questionario"); echo "<select name='ativo'>"; while($reg =…
-
38
votes9
answers166445
viewsA: How to hide/show a div in HTML?
The solutions below will give a way of how to implement in various situations. Pure Javascript function Mudarestado(el) { var display = document.getElementById(el).style.display; if(display ==…
-
2
votes1
answer1703
viewsA: Bring the last five in a row
I’m finding it very strange that the above one didn’t work, anyway, do it var result_evento = (from ev in db.T_CRM_Evento where ev.DE_CNPJ == carregagrid.Cnpj select new { ev.ID_CRM_Evento,…
-
9
votes1
answer9035
viewsA: Scroll bar on a table with bootstrap
Simple, in html do so: <div class="table-overflow"> <table> ... </table> </div> In the CSS .table-overflow { max-height:400px; overflow-y:auto; } Just implement to your…