Perguntas com a marcação «javascript»

Para perguntas sobre programação em ECMAScript (JavaScript / JS) e seus vários dialetos / implementações (excluindo ActionScript). Essa tag raramente é usada sozinha, mas costuma ser associada às tags [node.js], [jquery], [json] e [html].






4
setState vs replaceState em React.js
Eu sou novo na Biblioteca React.js e estava lendo alguns dos tutoriais e me deparei com: this.setState this.replaceState A descrição dada não é muito clara (IMO). setState is done to 'set' the state of a value, even if its already set in the 'getInitialState' function. Similarmente, The replaceState() method is …


9
TypeError: p.easing [this.easing] não é uma função
Ao tentar mostrar um elemento div com jQuery, recebi este erro: [23:50:35.971] TypeError: p.easing[this.easing] is not a function @ file:///D:/html5%20puzzle/jquery.js:2 A função relevante é esta: function showWithAnimation(){ console.log('animation called'); $('#popup').show(); $("#popup").css({"top": "30%", "left": "30%"}) .animate({top:(($(window).height()/2)-($('#popup') .outerHeight()/2))-70}, 1000, 'easeOutBounce') .show(); } A função é responsável por mostrar o div com uma …



7
Como criar string JSON em JavaScript?
window.onload = function(){ var obj = '{ "name" : "Raj", "age" : 32, "married" : false }'; var val = eval('(' + obj + ')'); alert( "name : " + val.name + "\n" + "age : " + val.age + "\n" + "married : " + val.married ); } Em …
96 javascript  json 



7
Função aninhada de JavaScript
Recebi um pedaço de código para javascript que simplesmente não entendo: function dmy(d) { function pad2(n) { return (n < 10) ? '0' + n : n; } return pad2(d.getUTCDate()) + '/' + pad2(d.getUTCMonth() + 1) + '/' + d.getUTCFullYear(); } function outerFunc(base) { var punc = "!"; //inner function …


Ao utilizar nosso site, você reconhece que leu e compreendeu nossa Política de Cookies e nossa Política de Privacidade.
Licensed under cc by-sa 3.0 with attribution required.