Function call more than once in jQuery

I have a function called "go ()" that needs to be called three times on the page load. Right now, I called it to the finished event div with the class "nav". Can anyone suggest what I can call the go function thrice. Adding go () calls one after the other calls only once.

$('.nav').ready(function() {
     go();
    });
+3
source share
5 answers

Even if you say that this does not work, it should ...

$('.nav').ready(function() {
     go();
     go();
     go();
    });

Update: If there is an error in your go () function, it may stop executing before go () returns for the first time. Run in Firebug and see if you get any errors.

+4
source
$('.nav').ready(function() {
     go();
     go();
     go();
    });

Must call him three times.

+2

, . , -, go() , - , , .. , go() - , / , 3 .

+2

rikh sayd, .

, , , go() - :

function go() {
  alert("hello");
}
0

, , ... , , jQuery, , , - . datepicker , , - form. , id:

<script>
   $( function() {
     $( "#datepicker" ).datepicker();
   } );
</script>  


<script>
 $( function() {
   $( "#datepicker2" ).datepicker();
 });
</script> 

form body - :

:

<input name="DateIn" type="text" id="datepicker" style="width:90px"/>

:

<input name="DateOut" type="text" id="datepicker2" style="width:90px">

, , 3 #go1, #go2, #go3 html. , .

0
source

Source: https://habr.com/ru/post/1709672/


All Articles