Questions tagged as 'javascript'

2
answers

How to filter data from a JSON with JS?

Well, I'd like to know how to do a "select" within a JSON file using JS. Example: IhaveatablebelowusingdatacomingfromaJSONfile,butIwantedtomakeafilterforwhenIclicksearch,itdropthetableintotheresult.Note:IdonothandlealotofJSframeworks,buti...
asked by 14.09.2015 / 19:27
2
answers

Get JSON data array and print with jQuery

I have a JSON in the following format: { "representantes": [ { "nome": "Foo LTDA", "endereco": "Alameda dos Anjos", "cep": "12345-000", "telefone": "(11) 1234-1234", "site":...
asked by 13.02.2014 / 16:08
1
answer

What are classes, how do you use them, and JavaScript?

I started studying programming and JavaScript for 3 months, but so far only in technique. However, I realized that it is much easier to understand the concept of object orientation. I already know that objects in programming are like real-life o...
asked by 11.10.2014 / 08:44
2
answers

How to clean a canvas area?

I created a function that is generating random objects in the canvas area and wanted to clear the area after the function was finished. Is there any way to do this?     
asked by 17.02.2014 / 06:51
2
answers

How to do multiple replace using variable as first parameter?

When I want to do a replace on all occurrences of a string I do this: var ola= "ola mundo ola mundo"; ola = ola.replace(/ola/g, "xxx"); Result: "xxx world xxx world"; But I want to use a variable instead of putting the word explicit, li...
asked by 23.02.2015 / 22:04
4
answers

How to get a String that is between tags using Javascript using Regex

I have the following string: var text = "Meu nome <[email protected]>"; I would like to only get [email protected] , using Regex.     
asked by 30.01.2017 / 14:19
3
answers

Create a real "loading ..."?

I've been researching some cool effects for a "Loading ..." But I noticed that on all sites, they use timeout to get the animation in and out of the page, so it's just a beautiful cover of some cake. So I stopped to think, timeout based on...
asked by 22.05.2015 / 21:19
2
answers

How to get the parent / parent object instance in a javascript function?

I'm implementing a method extension library of prototype , and if I do it simply everything works perfectly as you can see in the simple example below: String.prototype.append = function(value) { // aqui o this é a instancia da...
asked by 09.10.2015 / 21:01
3
answers

How to use double and single quotation marks?

Let's imagine the following example : $color = "red"; echo ("<button onclick='change_background("/red"/);'>$color</button>"); What should I use when I have 3 levels using the example in change_background("/red"/); ?...
asked by 30.09.2015 / 14:07
2
answers

How to transform string into character array?

Is it possible to transform string into an array of characters? I only found the method .split(param); I'd like to convert a string to a% of characters , a character in each index. I would like array to become 'oi'...
asked by 21.12.2016 / 04:33