Questions tagged as 'javascript'

2
answers

Is there any more optimized way to "multiply" a string without using repetition?

I'm creating an algorithm in JavaScript, and I'm already finding it too cumbersome. Now I need a string "multiplied" N times. I would like to know if it is possible to do this without using a retry. For example, for the algorithm to return "w...
asked by 08.06.2018 / 02:24
1
answer

Is there a difference between the syntax of Self-Invoking-Functions?

I've learned three ways to write Self Invoking Functions , Immediately-Invoked Function Expression (IIFE) , and I wondered if there was any difference between them. (function () { console.log("Olá"); })(); (function () { console.log...
asked by 05.06.2015 / 15:45
3
answers

How can I get each selected checkbox and put it inside an input?

I have some checkboxes and I want you to click on a button, all the names of those selected, go to an input separated by ",". I tried to do this, but it did not work: <input type="checkbox" name="cbx-1"> <input type="checkbox" name...
asked by 16.01.2018 / 18:16
3
answers

How to hide a text being bigger than my Div

The purpose of the exercise is to study, I am creating a blog that has stories about dubbing and one of the objectives is to hide the text, which is much larger than my Div, so when clicking on the post the person is redirected to a page with th...
asked by 11.01.2018 / 19:14
2
answers

Enable select option with javascript / jquery

I'm developing software, but I can not enable a select. The intent is to check the select enable automatically. How do I do this? function habilitarSofa() { var radios = document.getElementsByName("sofa[]"); for (var i = 0; i <...
asked by 18.12.2017 / 15:15
2
answers

Block access to javascript files

I have a javascript file that does ajax requests for my API, but I do not want anyone to find out the link to it, is there any way to block access to this file? If you do not have some way to release so only the site can access?     
asked by 08.06.2015 / 03:21
1
answer

Execute function when clicking on "textarea"

How to execute a function when a <textarea> is clicked?     
asked by 25.04.2014 / 14:30
1
answer

Change "copy" to "copied" in clipboard.js after click

I'm trying to make the clipboard.js change the copy button from "COPY" to "COPIED" after the click without losing the function it has that selects the target code. Would anyone know what I should do? ! function() { for (var a = docum...
asked by 23.12.2017 / 07:31
1
answer

JavaScript Initialization of Objects [closed]

I'm new to JavaScript, and I'm using a framework Restart written with AngularJs for HTTPS requests. I'm having a lot of trouble initializing a literal object, with the following structure: $scope.niveisDeAcesso = [ {nivel:"LISTAR", selec...
asked by 29.07.2014 / 03:37
3
answers

PHP Execution via Ajax jQuery

I'm putting some instructions inside a same PHP file that are executed according to the value of the send variable received, at least that's what I thought. In this code you have two of these instructions, one that receives send == 'bu...
asked by 02.08.2014 / 15:54