Questions tagged as 'javascript'

2
answers

Get the last word of a String and put it at the beginning with jQuery

I have the phrase: " Tomorrow it will rain ". I want to get the last word and leave it like this: " Rain, Tomorrow will ". I'm doing it this way: var frase = 'Amanhã vai chover'; var palavra = strg.split(' ')[0];// I can get the: Tomor...
asked by 03.11.2017 / 07:09
3
answers

Download images with JavaScript

Well, I'm needing a script to automatically download images to me. For example the url f% of the image starts at link /the_gamer/the_gamer035-01.jpg to link , so I need a% com_of% to download all the images, if it is possible I ne...
asked by 03.10.2017 / 13:35
3
answers

How do I get the text of the selected option within a select?

I have the following code: <option value="1">item 1</option> <option value="2">item 1</option> <option value="3">item 1</option> I want to get the text inside the <option> that is selected. F...
asked by 07.11.2017 / 13:10
3
answers

How do I run the script after loading the page

I'm having a question about framework7, how do I run the scripts after dynamically loading the page, example: mainView.router.loadPage("pagina.html) [script que registram eventos nos botoes da pagina acima] $("#capturarFoto").unbind().bind(...
asked by 25.09.2017 / 15:12
3
answers

Getting TD value and putting it in the array - JavaScript

I need to get the value of a td and place it in the array as in the following example: function finalizaCompra() { var tbl = document.getElementById("tblItens"); var produto = []; if (tbl != null) { for (var i = 0;...
asked by 01.11.2017 / 12:28
3
answers

Change object value

I have an array with objects similar to this: [{ name: '2015', data: [...] color: 'orange' }, { name: '2016', data: [...] color: 'red' } ] I would like to change the value of na...
asked by 01.11.2016 / 13:57
3
answers

How many days does the current month have with Javascript?

I would like to know how many days the current month has with Javascript, for example with PHP, I would do so: Date('t'); Very simple with PHP, but what about Javascript with some easy way? Obs. I use AngularJS if it helps in anything....
asked by 08.02.2017 / 23:56
2
answers

When using jQuery append it displays the text [object Object] and does not insert the element

I created a div.box in the html and in it I want to insert another div that I create in the code execution, follow the abbreviation: HTML: <div class="box"></div> JS: var item = $('<div />', {class: 'item'}) var box =...
asked by 20.02.2017 / 14:50
1
answer

Problem with return

I'm having problem with return since node is all asynchronous. var myFUNC = function(A, B) { A.every(function(AA) { return (AA === B); }); return true; }; if(!myFUNC(...)) { .... } Of course t...
asked by 02.11.2015 / 17:24
2
answers

Check string? [closed]

In event keyup of a input I want to check the following cases: If string has letter and number "abc123" ; If string is uppercase and lowercase "aBc" ; If string has numeric alpha character...
asked by 28.12.2015 / 21:09