Questions tagged as 'javascript'

1
answer

Get File Size in Bytes in Java Script

I'm validating the attached file size on my page before upload using the following code: var tamanhoArquivo = parseInt(document.getElementById("documento").files[0].size); if(tamanhoArquivo > 2097152){ //MAX_FILE_SIZE = 2097152 Byte...
asked by 26.11.2014 / 15:09
1
answer

Change pages url with ajax and load in another browser

I'm having the following problem, I'm developing a web application in java and would like to know how do I change the URL of a page when I click on a link in the menu. For example: Access a website www.example.com.br this is the main link and...
asked by 29.12.2014 / 19:21
1
answer

How to compare two dates in Javascript or jQuery

I'm trying to compare two dates coming from fields text , turning them into object Date , as follows (the first function is to format the field input with XX/XX/XXXX ): function formatar(mascara, documento){...
asked by 07.06.2015 / 01:11
1
answer

Check server uptime with Node.js

I'm doing multiple HTTP requests at a given time, and I want to check only the return status . There are paths that require login in the application but as it is a very basic script and is not interface test I do not find it necessary to use...
asked by 30.05.2015 / 21:25
1
answer

Is it possible to implement null or undefined methods?

If I wanted to implement a variable check whenever I was to use the .indexOf() method of javascript would it be possible? For example, using a.indexOf(b); can detect when a is null or undefined and change me...
asked by 16.04.2015 / 19:30
2
answers

Pass parameter of a function according to the value clicked with JavaScript

I need to pass the value of a function according to its clicked value. There are 3 divs, each one is a gallery. I need to click on the "see more" option, open a page with all the photos only from that gallery, however, I do not know how to pass...
asked by 15.04.2015 / 00:03
2
answers

Click on Notification Desktop and go to the same window without refreshing the page

I am developing a chat with WebSocket and I have a problem, when I send a message to a friend, he receives the desktop notification (from the Browser he is) and when he clicks on the notification he goes to the conversation window of the person...
asked by 10.05.2015 / 17:56
4
answers

JavaScript function for leading zeros with MVC 5

I have a loop inside my cshtml file. This loop has a i variable and I use it to compose a name according to its position in the loop, type txtNome1 , txtNome2 , txtNome3 , and so on. I need to make the variable be com...
asked by 13.03.2014 / 21:32
1
answer

How to change the position of Ticks elements in JqPlot?

I need to know how to change the position of the Ticks to be diagonal rather than vertical, because as shown in the attached image, the names overwrite one another when they reach a certain size. <script type="text/javascript"> $(doc...
asked by 18.02.2014 / 14:09
2
answers

How to select / deselect a multiple select input at each mouse click? (without Ctrl)

I'm trying to make a script to select multiple options of a <select multiple> with each mouse click. So far so good, I've got and follows the code: var numSelected = 0; var valSelectedArray = []; $(document).on('mouseup',...
asked by 12.02.2014 / 17:14