Questions tagged as 'javascript'

4
answers

Passing javascript object by parameter in ajax callback

I know to pass string: onclick="popularEdicaoRetrofit(\''+data[i]+'\');" and number: var criarRetrofit = onclick="criarRetrofit('+data[i].idRetrofit+');" I would like to know how to pass an object as a parameter to the javascript funct...
asked by 02.07.2015 / 15:36
2
answers

Fill Second Input automatically when filling the First

I have a input that I'll give the name of input-1 , and there I'll insert this: 12:00 When I have a second input that I am going to give the name of input-2 , it is possible to insert in input-1 : 12:...
asked by 23.04.2015 / 01:10
2
answers

Hide Div after x seconds after performing action

Good morning, people, I have in my home a field to consult CPF. The field has only a text field, where I inform the CPF, if I find any cpf in the database, it returns some data to me. I submit the form with ajax, not to reload the page, in th...
asked by 12.06.2015 / 14:49
1
answer

How to add a class to a div when it is active, so that it changes color?

I'm making a Bootstrap-based website, in which I have a portfolio zone, in which thumbnails open a respective collapsible DIV. I need when a collapsible DIV is open, the respective thumbnail changes its CSS formatting, in this case color. I trie...
asked by 28.03.2014 / 18:35
1
answer

How to trigger a function after a certain date and time

I'm trying to make a script that triggers a certain function after a date and time has passed. I have tried in all ways but I can not, always with some error or bug. My last test did so: var time = '08/03/2014 23:45'; setInterval(function() {...
asked by 09.03.2014 / 03:52
4
answers

Get the html of a created variable

I have a problem concatenating variables I've already created (I know .concat() ) and everything. Problem: var input1 = $('input').attr({ type: 'hidden', value: 1 }); var input1_2 = $('input').attr({...
asked by 16.06.2017 / 13:52
3
answers

Add javascript to Wordpress plugin

I registered my Javascript file in my plugin, but the functions of click and so on. do not work. I registered my main plugin file with action : function add_scripts_to_plugin() { wp_enqueue_script( 'birthdate_celebrate_js'...
asked by 11.07.2017 / 16:55
2
answers

Position cursor at end of text when clicking input

Can you make every time I click the input the cursor moves to the end of it? Notice that in this image it is before 1 and wanted every time you click on the input it goes to the end.     
asked by 06.06.2017 / 21:47
3
answers

is there any way to close a browser tab with javascript? [duplicate]

I have a script that only works locally. Is there any way to close the browser tab using javascript ? If so, could you give examples?     
asked by 16.07.2015 / 20:10
2
answers

Clear input when user starts typing

Good afternoon, maybe this answer or this question already exists. But I did not find it here or google the way I need it. I found several scripts to delete the field of an html form when the user clicks on a particular input, however, what I ne...
asked by 08.09.2015 / 17:53