Questions tagged as 'javascript'

2
answers

How to change the value of the checkbox with jquery

How do I change the value of checkbox when it is selected? Code done so far it shows me object. $("#checkbox").change(function(){ var atual = $("#checkbox").val(); $("p").text(atual); // vamus supor que aqui o valor seja 23...
asked by 10.06.2016 / 13:53
1
answer

Are the escaped variables deleted even in JavaScript?

In JavaScript, whenever the block of a variable scope executes, all its variables are deleted (as they say around the site) ... (function() { var a = false; })() But then why when I call setTimeout to alert the value of a variabl...
asked by 12.06.2016 / 02:01
1
answer

How to get current date with the time in js?

How to get current date with the time in js? I need to know how many days ran after a certain date. I'm using the momentjs var start = moment( "2016/06/17" ); var end = moment( new Date() ); var time = date_start.to(date_end); console.log(...
asked by 17.06.2016 / 22:45
2
answers

Error encountering NodeJS module

I'm following a book of NodeJS and it's giving the following error: Error: Cannot find module './app/routes/home' I have reviewed several times and found nothing wrong, here is the code: Express.js // config/express.js var expre...
asked by 24.08.2015 / 22:36
1
answer

How to customize google-translate on my site?

How to put images of language flags, and when you click on the flag, the whole content of the site changes language? I'm using this code: html: <div id="google_translate_element" class="boxTradutor"></div> JavaScript: &l...
asked by 26.08.2015 / 20:59
1
answer

video tag controlling by javascript

How do I, when I click on the video, it starts loading, because I can not if someone can help thanks. Here is the video snippet: <div class="video"> <video class="video" loop controls tabindex="0"> <source src="video...
asked by 24.08.2015 / 20:57
2
answers

How to keep page updated without refresh?

I'm trying to create a page that stays up-to-date without having to refresh. I created a Javascript function that looks for select and while of another page, but this is generating high CPU consumption and the server faces have...
asked by 10.09.2015 / 05:17
1
answer

Use / Escape @ in CSHTML view

I'm having a jQuery code on the CSHTML page and I'm having trouble validating the email with a regular expression since @ is a Razor command in .NET. How do I resolve this problem? Follow the script: $("#formEsqueceuSenha").submit(fu...
asked by 11.09.2015 / 14:55
2
answers

Array jQuery - Remove indices and concatenate html

I'm making an ajax call that retweets the Html of filters to be put on a particular div. However I would like to remove some html elements previously. For that I passed the html to jQuery, thus turning it into an array. After removing the elemen...
asked by 14.09.2015 / 22:47
1
answer

How to pass arguments dynamically to a new call?

If I have a JavaScript function and I want to call it by passing a list of arguments, I use apply : var x = f(1,2,3); var x = f.apply(null, [1,2,3]); For the first time, I came across a case where I need to call a constructor with a...
asked by 15.09.2015 / 08:10