Questions tagged as 'javascript'

1
answer

redirect with javascript according to form field

I have a form that receives a string and sends it to a java servlet. I'm trying to add a javascript code that allows, if the user enters "000", redirects to the login page. I do this by placing an eventlist onsubmit in the form, but the function...
asked by 03.11.2016 / 02:03
1
answer

Prevent entry of keyCode = 222 and keyCode = 186

I'm restricting the entry of certain characters to input type="text" , I need only numbers can be entered, I have almost ready but the only problem is that I can not prevent the characters of the keyCode keys == 222 and 186 they are entere...
asked by 05.11.2016 / 23:01
1
answer

How to make mix of MVC Razor and javascript when there is "}"?

I have a list of objects that I send to view to show images as a book, so I do a mix of razor with javascript , but it gives me an error by the } keys. Code: <script type="text/javascript"> $(document).ready(fu...
asked by 28.10.2016 / 00:30
2
answers

Random error when traversing a json in a javascript function

I have an error of: data [key] .forEach is not a function. but it is totally random, sometimes perfectly executes others not. This is my code: <script type="text/javascript"> $(document).ready(function() { var table = $('#example'...
asked by 26.10.2016 / 21:23
1
answer

error when publishing Azure site

Create an application with the WebAplication template of Visual Studio 2015 with MVC, it handles the Scripts and CSS by bundle, it turns out that When I publish in Azure I do not load any style, I could not make it published correctly....
asked by 30.09.2016 / 14:04
2
answers

Delete fields with Javascript

I want to remove field by field but it removes all fields and blocks adding var nextinput = 0; function AgregarCampos() { nextinput++; var campo = '<div class="row"><div class="col-xs-4"><p><input type="text...
asked by 30.03.2017 / 20:37
1
answer

Group and accumulate values in JavaScript

Dear: I have the following file JSON with information: var rawtData = [ { date: "2015-01-03", "pv": 50, "ac": 100, "ev": 50 }, { date: "2015-01-01", "pv": 100, "ac": 200, "ev": 200 }, { dat...
asked by 22.02.2017 / 21:33
2
answers

Regex in javascript that selects something that on its sides (left, right or both) does not have certain terms

I am trying to find a regular expression that selects me those spaces in whites that on its left side, right side or both have any word except a specific word. The regex must obtain the following result: Internal spaces that you should...
asked by 13.10.2016 / 01:32
1
answer

Load data in $ scope dynamically

I have a call to an API, in which I recover several data. I just want to show some of the fields, so I have created an array with the fields I want to show: var CamposAPI = ['a','b','c','d','e','f']; var campo = CamposAPI[i]; (está dentro d...
asked by 10.10.2016 / 15:54
2
answers

How to edit a url with JS?

In the JS that I am developing, I must enter and / or use a url dinámica in case the project name changes ... For this reason, try using the following: alert(window.location.pathname); which shows me the following /proyecto/ind...
asked by 06.04.2017 / 13:18