Posts by Daniel • 436 points
6 posts
-
3
votes2
answers8665
viewsA: How to clone an element in Javascript?
In jQuery there is the method jQuery.clone which allows cloning elements (with or without their respective events) Consider the following example HTML structure <div class="wrapper"> <div…
-
2
votes5
answers98198
viewsA: How to display the result of a query on an PHP html page?
All functions mysql_fetch_* return a single line and advance the internal cursor to the next record. To get all records, you need to use them within some repeating structure. Example: while ($exibe…
-
11
votes5
answers12033
viewsA: How to change the value of a "date" attribute in Jquery?
var valor = 0; $('#botao').on('click', function () { valor++; $(this).data('order', 'day-' + valor); }); Example: http://jsfiddle.net/Agr7p/ I made a change in the example just to make the…
-
9
votes4
answers141141
viewsA: How to redirect the user to another Javascript/jQuery page?
Via jQuery (only for knowledge if desired) $(location).attr('href', 'http://www.sitedesejado.com'); However, as already mentioned, it is not necessary jQuery to perform redirection.…
-
0
votes2
answers3183
viewsA: PDF from a PHP
The class DOMPDF is a good alternative for your purpose It allows you to convert HTML to PDF by reading its DOM structure. Below is an extremely simple example of its use <?php // Inclui a classe…
-
7
votes6
answers66760
viewsA: "foreach" in Javascript
Via jQuery, for a simple approach, you can use the jQuery.each() method that allows you to iterate over objects/arrays by separating them by index/value Example: $.each([ 'a', 'b', 'c' ], function(…