Questions tagged as 'javascript'

3
answers

How to use $ .on in pure JavaScript: "$ (...) .on (event, selector, function)"?

This is in jQuery we have on , any element <a> with class test e without the foo class will fire the function when clicked, even though you create the element after the event is already added: $("#new...
asked by 06.06.2017 / 21:42
3
answers

What is the difference between double quotation marks and single quotes in Javascript?

Context In PHP, there is a difference between the use of single and double quotes. In this case, single quotes are for "% common%", and double quotes, used when you want to process strings (concatenate, for example). Question Is...
asked by 01.02.2014 / 20:47
4
answers

Is it possible to create an 'abstract class' in Javascript?

When creating a Javascript class whose attributes and methods are all static (for example, for storing predefined settings for a game), I would like to know if it is possible to define the class as abstract in a similar way as it can be (where t...
asked by 14.01.2014 / 02:05
1
answer

What is the difference between these two implementations?

I was reading some articles on patterns and I was struck by a doubt in the following two examples. Suppose I have a single function that returns me an element by means of the ID sent as argument. The first one: var utils = (function(){ v...
asked by 27.03.2015 / 16:55
1
answer

In new browsers now there will be no more synchronous requests?

I saw today in my Google Chrome , updated to version 40.0.2214.91 , a message that said    Synchronous XMLHttpRequest on the main thread is deprecated because of   its detrimental effects to the end user's experience translati...
asked by 23.01.2015 / 12:07
3
answers

What are the ways to apply eval in Javascript

There is more than one way to make a eval() in javascript, problem is that it can be a danger to the user if misused. Internally some other methods also make eval, for example setTimeout() that if put in the argument of callb...
asked by 08.02.2014 / 16:52
3
answers

Why is it bad practice to use inline Javascript?

The title already describes the question: why is it considered bad practice to use CSS and Javascript inline in our codes? Is it bad to use this even on smaller projects?     
asked by 18.07.2014 / 17:09
4
answers

Is there a Site / API for hosting photos on the web?

I wonder if there are any APIs that allow you to host photos on the web. Example: cloud.push(arquivo, callback, fail); I'm going to use this API to enable users to host images for profile photo, etc. (I currently do this using base64, bu...
asked by 25.02.2014 / 02:50
4
answers

Is it possible to access the property an object inside itself?

Cadastro = { "descricao" : "Novo usuário", "editando" : false } Is it possible at runtime to get the property value "editing" and use it? Something like: Cadastro = { "descricao" : "Novo usuário", "editando" : false, "...
asked by 16.05.2016 / 14:15
2
answers

Simple pagination in jQuery / Javascript

I'm looking for a simple pagination, no CSS styles, or anything like that. Only with the buttons below to change the page and with the elements on top. I'm asking, because the examples I find are a bit complex for me. I'm loading the data usi...
asked by 20.02.2014 / 18:58