Questions tagged as 'javascript'

1
answer

Difference between escape, encodeURI and encodeURIComponent

What's the difference between these three functions, and when to use each one of them? escape() encodeURI() encodeURIComponent()
asked by 18.12.2017 / 18:43
1
answer

How does the $ .when () and the .then () aligned

In my studies of javascript with Jquery framework , I have come across several times with $.when() and .then() aligned. I wonder how they work together. an example that I came across was the code below. $.when(loadView, setData)...
asked by 25.08.2015 / 01:18
2
answers

How to create a single method to handle errors with ajax

I have a web app that runs several ajax calls . My faculty professor challenged me to create a generic message and unite the entire error handling in a single function. Can anybody help me ? function getShoes() { $.get( "/Shoes/List", fu...
asked by 04.09.2015 / 04:45
1
answer

Desktop development with Electron

With the growth of web many people have abandoned desktop development, but some interesting technologies have come out, such as Electron :    Electron lets you create desktop applications with pure JavaScript through   of a runtime wi...
asked by 04.11.2015 / 16:27
1
answer

Progressive and cumulative hours counter with days

I have a project where I must accumulate hours worked for a service in a project, it should store in the bank the hours / days. Then when started, if there is no previous time it starts from zero, but if there has already been a step previous...
asked by 07.12.2015 / 13:14
1
answer

Is there any way to save the webcam through HTML5?

I know there is a way (I've even used it on at least 5 systems that I've developed) to open the webcam through HTML5 and capture a photo (I do this using canvas ). Html5 Camera Capture Sample But I had a question: Can I capture this...
asked by 06.11.2017 / 14:32
1
answer

What does this anti-theft code in Javascript do?

What does this anti-theft code in Javascript do? <html><head></head><body onload="challenge();"> <script> eval(function(p,a,c,k,e,r){e=function(c){return c.toString(a)};if(!''.replace(/^/,String)){while(c--)r[e(c)...
asked by 19.05.2015 / 16:47
2
answers

Sliding effect on 'anchor' links

I have a OnePage page and the anchor links of the menus when they clicked they only " skip " for the section of screen below but I wanted them slid gently to the intended 'anchor' section. I tried to put transition via CSS and I wa...
asked by 01.10.2015 / 19:21
2
answers

How to convert the first letter of words into a string

Having a given string, how to put the first letter of each word in large letters (Uppercase)? For example: original: 'a música é universal' High: 'A Música É Universal' but also names like "anna-karin" common in...
asked by 27.11.2014 / 20:41
4
answers

How to format a value in JavaScript?

What is the simplest way to format 1234213412341 to 1234.2134.1234-1 using JavaScript? <script> function formatar_valor(strvalor){ var formatado; // formata return formatado } alert(forma...
asked by 20.03.2015 / 05:40