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>

12th Feb 2019, 10:20 PM
Dev Anand
Dev Anand - avatar
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.
12th Feb 2019, 10:53 PM
peter
peter - avatar
+ 1
ŠæрŠ¾Š¹Š“Šø Š“Š¾ ŠŗŠ¾Š½Ń†Š° Šŗурс javascript Šø ты уŠ·Š½Š°ŠµŃˆŃŒ эту тŠ°Š¹Š½Ńƒ
12th Feb 2019, 10:32 PM
_yaroslavv [online_everyday]
_yaroslavv [online_everyday] - avatar