Questions tagged as 'javascript'

1
answer

Call JS function within modal

I have an event where a modal is displayed, in it I want to call a function validateEmail but I can not. validateEmail: function(email) { var re = /^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@((\[[0...
asked by 23.02.2015 / 18:24
1
answer

Multiplication and sum of dynamic inputs

Note: Developed with Laravel 5.7. Note 2: This is the "New Order" view. The form will dynamically receive the products according to their previously registered items. Until then, okay! The user will bookmark the product and enter the desi...
asked by 13.12.2018 / 15:25
2
answers

jqGrid does not call the blockUI method without using window.setTimeOut when the ajax request fails

I'm using jqGrid 4.54 in my project and I want to put a message blocking the whole screen with the blockUI in> when my AJAX request encounters an error on the server as error 500. I know that 2.66.0 does not work with synchronous A...
asked by 29.01.2014 / 14:02
1
answer

Add "thead" to a table created with createElement

I have the following code, which creates a table, using createElement() : var context = document.createElement('table'); var row; context.className = 'table'; row = context.insertRow(); row.insertCell().innerHTML = 'foo'; row.insertCell...
asked by 18.01.2014 / 21:19
2
answers

What is the most efficient way to calculate the HashCode of an object in Javascript?

I'm currently using Object.prototype.GetHashCode = function () { var s = this instanceof Object ? JSON.stringify(this) : this.toString(); var hash = 0; if (s.length === 0) return hash; for (var i = 0; i < s.length; ++i) {...
asked by 17.12.2013 / 16:09
2
answers

JavaScript Recursive Functions

Someone could ask me a question! function recursiveFatorial(x){ if (x == 0) return 1; else return x * recursiveFatorial(x-1); } console.log("Resultado da funcao recursiveFatorial: ",recursiveFatorial(10)); /* Output 10! 10 x 9 x 8 x...
asked by 05.05.2017 / 04:52
1
answer

What is the difference between Lexical Scope and Dynamic Scope in Javascript?

What is the difference between Lexical Scope and Dynamic Scope ? What are the advantages of using each of them? When should they be used?
asked by 30.03.2017 / 15:27
1
answer

How to pick up / drop object in localstorage?

I'm sending a JSON object to localStorage : window.localStorage.setItem('tarefa',aux); And I try to get this object on another controller like this: $scope.tarefa=window.localStorage.getItem('tarefa') However, when displaying on...
asked by 21.03.2017 / 14:49
3
answers

How to deal with upper and lower case letters along with Symbols

I have the following snippet running cute: function busca() { var str = document.getElementById('txt').value; if(document.getElementById(str)) console.log(str + ' existe.'); else console.log(str + ' ñ existe'); }...
asked by 13.04.2017 / 12:46
1
answer

Script to leave my site (game) mute

I have a project in localhost (game in HTML 5, JS and CSS), in the background of the game plays a song, I can not make the button to turn off the sound works, someone knows some article that teaches or method of doing This? I'm sorry I missed...
asked by 16.06.2015 / 15:12