Questions tagged as 'javascript'

3
answers

How to execute an insert only once via javascript / jQuery

I have a situation where I need to insert a div once in a block via jQuery, is there any function already defined that guarantees that this block will be inserted only once? Without me having to check with if if (!jQuery('.product').parents('....
asked by 17.08.2018 / 18:42
1
answer

Concatenation with Virgula and plus sign

I'm studying nodejs, and doing some testing with some native modules of the node I came across the following statement. To print free memory on your computer: const os = require('os'); console.log('Memoria Livre: ', os.freemem()); This...
asked by 21.08.2018 / 18:25
2
answers

How do I access a container inside another container in Jquery?

I'm making a function to modify these groups of buttons, but I'm not sure how to access containers inside containers with Jquery. <div class="buttons"> <button aria-label="Right">Right</button> <button aria-label="Left...
asked by 29.08.2018 / 16:00
1
answer

Function that returns another function returning itself

First of all, I am asking this out of sheer curiosity, it has no real application where this would be useful (or do I know?). I know that it is possible to make a function return another function, and that the returned function can be a param...
asked by 30.08.2018 / 16:48
1
answer

Get value returned in a URL with JS

I need to create a very simple script that makes a small calculation. I have a URL that returns a value in the following format: 10.00, something like this: link I need to create a function that takes the value returned from this UR...
asked by 24.08.2018 / 20:40
1
answer

___ ___ erkimt Take last array object [duplicate] ______ qstntxt ___

How can I always get the last object from the array at the moment I'm using the following function but only takes the first one.

%pre%     
______ azszpr326152 ___

You can search for length using %code% less than 1 that will always return the last item

%pre%
    
___

How can I always get the last object from the array at the moment I'm using the following function but only takes the first one. var IDs = arrayIds[0].id; [ { id: '1', }, { id: '2', }, { id: '3', } ]     
asked by 30.08.2018 / 17:05
1
answer

How to detect when scrolling an element comes to the end without jQuery?

I'm not able to understand this jQuery code. How can I convert the following code into JavaScript? $(document).ready(function() { $("#table").scroll(function() { if ($(this).scrollTop() + $(this).height() == $(this).get(0).scro...
asked by 06.07.2018 / 16:04
1
answer

$ () Ajax event does not work

I have a problem with the $().click() event of Ajax. I'm trying to send an HTML table to convert to JSON and so send it to PHP. But when I click the button to pick up the event, nothing happens. Even an error occurs on the console. The...
asked by 04.07.2018 / 15:17
1
answer

Regex - Remove between tag and start of class name and last tag closing

I have a string (html) and I need to remove everything that is between the first occurrence of <div class="c and first closing of the > tag and last closing of " </div> ". The first one should be this way because...
asked by 01.02.2018 / 14:50
1
answer

Open link in another browser in HTML

Good morning everyone! Next, I have a very simple HTML code, where I have an image linked to a link of a local application in the company (the application is web) or when I click on the image the page automatically redirects me the applicatio...
asked by 01.02.2018 / 15:17