How to make a jquery function call after "X" seconds How to make a jquery function call after "X" seconds jquery jquery

How to make a jquery function call after "X" seconds


You can just use the normal setTimeout method in JavaScript.

ie...

setTimeout( function(){     // Do something after 1 second   }  , 1000 );

In your example, you might want to use showStickySuccessToast directly.


If you could show the actual page, we, possibly, could help you better.

If you want to trigger the button only after the iframe is loaded, you mightwant to check if it has been loaded or use the iframe.onload:

<iframe .... onload='buttonWhatever(); '></iframe><script type="text/javascript">    function buttonWhatever() {        $("#<%=Button1.ClientID%>").click(function (event) {            $('#<%=TextBox1.ClientID%>').change(function () {                $('#various3').attr('href', $(this).val());            });            $("#<%=Button2.ClientID%>").click();        });        function showStickySuccessToast() {            $().toastmessage('showToast', {                text: 'Finished Processing!',                sticky: false,                position: 'middle-center',                type: 'success',                closeText: '',                close: function () { }            });        }    }</script>


try This

setTimeout( function(){     // call after 5 second   }  , 5000 );