0
How can i make the 2nd script tag code to be loaded after 3 seconds or after a certain element loads
<head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("div:contains(This Text)").css("display", "none"); }); </script> <script> $(function() { $("#contentPost").delay(1000).fadeIn(500); }); </script> </head> <body> <div id="contentPost">This text.</div> </body>
2 Answers
+ 1
look into scheduling calls, we might like to do things at set times set orders thus scheduling a call. some ways javascript does this can be setTimeout allows to run a function once after the interval of time.
setInterval allows to run a function regularly with the interval between the runs.
+ 1
ŠæŃŠ¾Š¹Š“Šø Š“Š¾ ŠŗŠ¾Š½ŃŠ° ŠŗŃŃŃ javascript Šø ŃŃ ŃŠ·Š½Š°ŠµŃŃ ŃŃŃ ŃŠ°Š¹Š½Ń