Questions tagged as 'javascript'

1
answer

Is it possible to generate JSON from Javascript?

Is there any way to do the JSON encode that is in PHP, but from JavaScript or jQuery? I need to pass an array that I create from JavaScript through an Ajax connection that I send by POST, and then this request is transformed by PHP into a GET...
asked by 21.06.2016 / 13:17
3
answers

Get img src="" when pressing image to insert in editor

Good morning companions. A huge doubt. There is a possibility that when you press an image this me of its <img src= ""> I say it because I am implementing an editor with ckeditor but I want that when pressing the image it is put i...
asked by 04.08.2017 / 18:19
2
answers

Clean content whose tag is the same

I have several span tags with the same class and I am treated by a function that traverses all span and clean its content. I have raised this but it does not work for me function limpiarError(){ var spanTag = docume...
asked by 01.12.2017 / 18:36
1
answer

Does not allow a pause to be executed within a loop

I'm trying to create a clock from nested while loops but I have not managed it so far <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>reloj</title> </head> <body>...
asked by 12.08.2017 / 06:10
3
answers

How to add columns of an HTML Table?

I just wanted to know how to add the columns, since I'm new and would like to know how to apply it with java script. This is my function: <table id="tabla" class="table" style="width:51%;"> <thead> &l...
asked by 29.08.2017 / 23:57
1
answer

Why does not the length of a chain show a different amount than the elements possessed?

Having this text string and applying the property length var texto = "Hola soy una arroba \u0040 , un placer"; console.log(texto.length); Returns: 33. If we count ourselves we would give: 38.    Why do you give a di...
asked by 29.04.2017 / 15:51
3
answers

Rotate a div for 30 seconds Jquery

Greetings, my query is as follows: I have a div block which I need to keep rotating for X amount of seconds, I have tried some Jquery libraries but I have not been able to control the time it keeps turning and the speed, this is important. Gr...
asked by 24.12.2016 / 15:25
3
answers

Browse json array object

I have the following json: [{titulo : "Total", balesia : 1, torre:2, CT:3, HF :6}, {titulo : "Total", balesia : 4, torre:2, CT:5, HF :8} ] I need to go through it and add only those that have a numerical value and store it in another object...
asked by 15.11.2016 / 18:50
2
answers

closure inside a loop

I have the following code, I do not understand the result var funcs = []; for (var i = 0; i < 3; i++) { funcs[i] = function() { console.log("el valor: " + i); }; } for (var j = 0; j < 3; j++) { fun...
asked by 30.12.2016 / 06:19
4
answers

How to know which mouse button was pressed

I want to know when a mouse button is pressed on the button , which was the pressed, if the left, right, or middle. The problem is that for the right click I get the typical menu. Nor does it detect if I press the middle one. How to detect...
asked by 20.07.2017 / 20:12