Questions tagged as 'javascript'

2
answers

Disable horizontal scroll; but allow the vertical

I'm trying to disable horizontal scroll on a website; but without affecting the vertical. I have a script that works like a slider by sliding the "body" of the page to the left and revealing more content. However, this creates an extra empty...
asked by 05.12.2015 / 08:44
3
answers

user search

1.- For the search based on the content of the divs, is that a good practice? 2.- When I perform a search, and then I delete all of the input, how do I return to its initial state, that is to say that all the users are shown, are there events...
asked by 14.02.2017 / 16:46
3
answers

Delete an array of duplicate objects in javascript

How to remove duplicate data from an array of objects?: example: var array = [ {id:1,nombre:'casa'}, {id:2,nombre:'fruta'}, {id:3,nombre:'mascotas'}, {id:1,nombre:'casa'}, {id:2,nombre:'fruta'}, {id:4,nombre:'cosas'}, {id:5,no...
asked by 27.12.2016 / 18:44
4
answers

Get object of an array by providing an attribute of the object

I have an array of objects like the following: var nicknames = [] nicknames.push( {id:"100", name:"Juan"} , {id:"200", name:"Mateo"} ); How can I get the data of one of the objects in the nicknames array by supplying the name or the...
asked by 06.12.2015 / 09:28
2
answers

Style half of a character

Is there any way to style only half of a character? For example, half of one color and the other half of another. Is there a CSS or JavaScript solution for this, or should we resort to images? (I know that there is a gradient, but we do no...
asked by 11.10.2017 / 11:07
5
answers

How to convert an HTML element to a string in javascript?

I access an element of my page and I save it in a variable: var nodo = document.getElementsByClassName('prueba'); if I do a var nodo = String(nodo); It does not work for me, I know it's an array of objects but if I pass it to a string...
asked by 24.02.2017 / 13:10
3
answers

Using single or double quotes in a text string

What differences are there when using single or double quotes for text strings in JavaScript? var daw = "Desarrollo de aplicaciones web"; var dam = 'Desarrollo de aplicaciones multiplataforma';     
asked by 13.10.2017 / 17:16
5
answers

Error in the if cycle

   The dreamweaver gives me an error on line 6 and I can not find it, I'm   new in programming I appreciate your time and your help a lot. <script> window.onload = function(){ var envia = document.getElementById(continuar); envi...
asked by 13.09.2016 / 04:51
1
answer

Javascript functions that execute part of other functions

I have a function that adds some details to the DataTable, the function is activated by a button that is to add, then hide the modal. what I want is that the user has the option to continue adding details a button that adds the details to the ta...
asked by 26.04.2018 / 20:18
3
answers

Delete text inside brackets in javascript

I have the following simple code: <input id="nick" type="text"/> <script> var c = document.getElementById('nick').value </script> I need to remove a part of the name, only if it has brackets [] . So if you have thi...
asked by 27.04.2017 / 00:55