Questions tagged as 'javascript'

2
answers

CORS header 'Access-Control-Allow-Origin' missing in aspx

I have an application that uses a Java script function and sends a call to consume a web service. Everything works fine but I do not get anything in the browser. When I see the console, a message appears CORS header 'Access-Control-Allo...
asked by 04.05.2016 / 20:46
4
answers

Obtain client IP from javascript or jquery

How can I get the% co_of real% of the client for% co_of% if possible. This means that there is a direct connection, or by means of a IP , or Javascript or whatever, I always identify the proxy real of the client computer....
asked by 03.05.2017 / 22:44
2
answers

How to get value from an input using jquery?

The following line: <a id="asociar-1500" style='color: #004881' href="#" title='Asociar al Proveedor' class="btn btn-danger"><input type="hidden" value = "true"></> It generates the following HTML: <a id="aosciar" cla...
asked by 06.05.2016 / 17:44
7
answers

Call functions with JavaScript parameters with Ajax $ ('Element') on ('click', func (param))

I need to pass a parameter to a JS function but:    when executing this code, call the function before clicking and also do not pass the parameter /*Este es el codigo AJAX al que quiero agregarle el parametro*/ $('#atribute').on('...
asked by 17.05.2018 / 15:05
3
answers

Prime numbers in javascript

I've been surfing the internet, but I can not find an algorithm to search for prime numbers. var cantidad = 100,j=2; for(var i=2;i<cantidad;i++) { for(;j<cantidad;j++) { if(j%i==0 && (i==j || i==1)) {...
asked by 29.08.2017 / 18:42
2
answers

Difference when capturing the text

What is the difference when using .text and .innerHTML to get the text? window.addEventListener('DOMContentLoaded',() => { var pattern = /^joya[0-9]/, getting = document.getElementsByTagName('*'), elements = [...
asked by 25.09.2017 / 12:32
3
answers

Divide each element of an array

I have this array promedio = [220,230]; and to each I need to divide it by var cantidad = 4;     
asked by 09.06.2017 / 16:38
6
answers

Alert JavaScript with Timer

How can I create an Alert in JavaScript that can be seen for 2 seconds and then close automatically (only) without the user clicking accept?     
asked by 23.08.2016 / 22:31
2
answers

How to import classes in JavaScript

When using Node.js to import a serious class: var Comprobador = require('./comprobador.js'); let comprobador=new Comprobador(); But in pure JavaScript on the client side, how would it be?     
asked by 24.02.2018 / 06:03
2
answers

Start the "count" of an array with 1 and not with 0

The fact is that I have the script done, which executes a loop to generate a series of sentences. I want the array account to start with 0 and not 1 , so that it makes sense. var colours = ["White", "Red", "Black", "Purple", "Grey", "Ye...
asked by 08.01.2018 / 19:20