Questions tagged as 'javascript'

1
answer

window.history.back returning only one page

I'm having problem with window.history.back() because it's returning only one page. I use the following function: <script type="text/javascript" charset="utf-8"> // Wait for device API libraries to load...
asked by 23.12.2015 / 19:27
3
answers

How do I check if a value starts with a slash followed by a message?

I get a value like this: /{mensagem} and if it was different (I did not have / before {mensagem) , I wanted it to return error. {mensagem} serves as variable and can not be changed.     
asked by 27.11.2014 / 16:45
2
answers

Adding tags li

I would like to know how to add the amount of <li> Here's an example: <ul> <li>exemplo 1</li> <li>exemplo 2</li> <li>exemplo 3</li> <li>exemplo 4</li...
asked by 27.10.2016 / 05:03
2
answers

JavaScript code does not execute prompt

prompt is not appearing: <script> function numero(int num) { return Math.round(Math.random() * num); }; var chute = prompt("Qual e o numero? "); var numeroPensado = numero(10); if(chute == numeroPensado) { document.write("Ac...
asked by 03.06.2016 / 04:28
2
answers

How do I save the option chosen by the html user in cookie? [duplicate]

I have a background change system by Javascript on my site, and I want it when the user chooses the background they want, the background he chose to hold when he accesses the site again. JavaScript function mudar9(){ document.body.backgro...
asked by 14.09.2014 / 15:56
3
answers

Is it dangerous to use for loop in querySelectorAll?

Whenever I need to select more than one element on a page, I can not use querySelector() , right? Then we must use querySelectorAll() . I've always used it as follows (img is just a hypothetical example): img = document.querySelect...
asked by 28.07.2014 / 22:12
2
answers

Get current date with Vue

I need to get the current date and format it of the following type:    December 17, 2018 I'm using the date within a project in Vue. The only reference I found was this however it is in pure javascript. Has anyone ever had to do s...
asked by 17.12.2018 / 12:52
3
answers

Remove characters in variable

I have a variable with the following content 00:00:01. I want to take the colon to have as final result 000001. I use the split but the result I have is 00,00,01. var res = min_time.split(':');     
asked by 07.01.2015 / 12:23
2
answers

Problems in PHP call [closed]

I have a problem calling a program by PHP passing parameters. Code: <? print("<script language=javascript> alert(\" <<< Dados Alterados com Sucesso! >>>\"); if($w_rec != "") {...
asked by 09.09.2014 / 15:33
3
answers

CSS, center separator between left and right [closed]

I have a div, welcome-inputs and within it another two left and right left must be on the left side of welcome-inputs and right on the right side of welcome-inputs . Both have width = 100p...
asked by 16.12.2014 / 17:42