Posts by Leonardo Cardoso • 61 points
4 posts
-
1
votes2
answers650
viewsA: How to create a javascript array in json format
You could use the json_encode function in this array Example: <?php $arr = array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5); echo json_encode($arr); ?> The above example…
javascriptanswered Leonardo Cardoso 61 -
2
votes2
answers167
viewsA: Instruction jQuery only works by console
Probably the call of your instructions is being made before the elements are loaded. Try to put the script to be loaded after its elements. Or put your function inside that call: $(function(){ //seu…
-
1
votes4
answers1118
viewsA: Automate click of button
To automate the click of the button I would do the following: First add an id to your button <a href="#modal-1" id="botao" class="cd-btn cd-modal-trigger">BOTÃO</a> Then inside a . js…
-
2
votes3
answers60
viewsA: Arrendondamento of javascript values
I believe this function would solve your problem: function arredondar(num) { if (num <= 500) { return Math.round(num / 10) * 10; } else { return Math.round(num / 500) * 500; } }…
javascriptanswered Leonardo Cardoso 61