Questions tagged as 'javascript'

1
answer

Javascript - Copy content from a span to clipboard by clicking a button [duplicate]

   I am creating a CPF generator, which when the person generates, a "Copy" option appears, but I would like to know how to implement the copying of the content that is displayed. ExampleHTMLCode:<spanid="numerosx">56262662</span...
asked by 16.08.2016 / 09:14
1
answer

JSON format file

And then everyone's beauty? I'm half doubt stupid, but I could not find an answer. I've been parsing a few sites and seen that instead of calling a $.AJAX request on the server to populate a dropdown data, for example, they call...
asked by 20.07.2016 / 15:02
2
answers

Confirm before submitting javascript function

When I submit a form, through onsubmit(checkFormIsCorrect()) , I call this javascript function that will validate several situations and submit or not the form. In this function: function checkFormIsCorrect() { if (!$('div.has-err...
asked by 29.08.2016 / 16:22
1
answer

Why is not javascript "{} + []" equal to 0?

I was watching a video that was shown to me by the user @CiganoMorrisonMendez , called WAT . There were some examples where they showed some bizarre things in some languages. In particular what caught my attention was this line of J...
asked by 16.05.2016 / 16:53
1
answer

Pass variables with same name to PHP

I can not get the field return in PHP, when I enter more than 01 in quantity .... can anyone help me? $(function() { var input = $('<input name="cp1" id="cp1" type="text" />'); var input2 = $('<input name="cp2" id="c...
asked by 03.07.2015 / 21:42
2
answers

Check input password

Hello, I'm starting to learn JavaScript, and I'm not getting any way to make my code validate if there are 3 uppercase, 2 numbers, and 1 special characters in my input. I would like to know what I should be making of error, because I made severa...
asked by 29.06.2015 / 04:46
1
answer

Is there any way for a div to take on the role of scroll?

I have the following code: $("#scroll").draggable({ axis: "x", scroll: true, containment: "#area" }); .area{ position: absolute; width: 1010px; height: 100px; margin-top:10px; margin-left:10px; overflow-x: auto; overflow-y...
asked by 24.06.2015 / 06:52
1
answer

Convert objects: from literal syntax to prototype types

Given a type defined in javascript, for example: var Point = (function () { function Point(x, y) { this.x = x; this.y = y; } Point.prototype.dist = function () { return Math.sqrt(this.x * this.y + this.x * t...
asked by 03.05.2014 / 17:18
2
answers

Debugging associated events via jQuery

When I want to debug an event associated with an element via jQuery, I can currently do it in the following ways: In Chrome, you can enable the debugger specifically for certain types of events. However, this is not useful when it is necess...
asked by 29.01.2014 / 14:12
3
answers

How to effectively remove the refresh meta tag from a page?

Lately I have accessed several news sites that use this meta tag to update their pages from time to time: <meta http-equiv="refresh" content="300"> I understand the reason for using it from sites, but over time this functionality beco...
asked by 31.01.2014 / 21:46