Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8693439
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:32:36+00:00 2026-06-13T00:32:36+00:00

This is my script: <script type=text/javascript> $(document).ready( function (){ setTimeout(‘myFun()’, 10000); }); function myFun()

  • 0

This is my script:

 <script type="text/javascript">
    $(document).ready(
    function (){

        setTimeout('myFun()', 10000);
     });

    function myFun() {
        var btn = document.getElementById('<%=myBtn.ClientID %>');
        alert(btn);
        btn.click();
     }
</script>

My markup:

<asp:UpdatePanel ID="upMain" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <asp:Label ID="lblValue" runat="server" Text=""></asp:Label>
    </ContentTemplate>
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="myBtn" EventName="Click" />
     </Triggers>
</asp:UpdatePanel>
<asp:Button ID="myBtn" runat="server" Text="hit" />

Code Behind:

protected void Page_Load(object sender, EventArgs e)
{
    if (!IsPostBack)
    {
        lblValue.Text = "0";
    }
    else
    {
        lblValue.Text = Convert.ToString(Convert.ToInt32(lblValue.Text) + 1);
    }
}

I need to refresh the updatepanel after every 10 seconds. But after page load, only once I’m able to achieve that. Is there anything I’m missing? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:32:37+00:00Added an answer on June 13, 2026 at 12:32 am

    why don’t you use the AJAX Timer control instead. It’ll serve the same purpose in a neat, concise & efficient manner.

    Anyways,
    Both setTimeout() & setInterval() work the same way.

    The key difference is that:

    • setTimeout will wait the specified period of time, run the code we give it, and then stop.
    • setInterval, on the other hand, will wait, run the code—then wait again and run the code again—repeating forever (or until we tell it to stop).

    In brief, setTimeout() runs the supplied code only once after the specified interval, whereas setInterval() runs the code again & again after the specified interval.

    So use:

    <script type="text/javascript">     
    $(document).ready(    
         function ()
         {          
                 setInterval('myFun()', 10000);      
         });
         function myFun() 
         {         
                 var btn = document.getElementById('<%=myBtn.ClientID %>');         
                 alert(btn);
                 btn.click();      
         } 
    </script> 
    

    Source: jQuery – Novice to Ninja

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the following code to load in content: <script type=text/javascript> jQuery.noConflict(); jQuery(document).ready(function(){ jQuery('.content-div').load(all-events.html);
I have this code <html> <head> <script src=jquery-1.7.2.min.js type=text/javascript></script> <script src=jquery-ui-1.8.20.custom.min.js type=text/javascript></script> <script type
look at this code, <head> <meta http-equiv=Content-Type content=text/html; charset=utf-8 /> <script> function change() {
HTML: <script src=http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js type=text/javascript></script> <script src=/js/grabber.js type=text/javascript></script> <script type=text/javascript> $(document).ready(function() { $('#search-js').submit(function() { var
I'm using tokenInput jquery plugin for autocomplete. This script is working fine <script type=text/javascript>
I'm using the following script: <script type=text/javascript> function processResult(xData, status) { $('.feedbackLink').empty(); alert ($(xData.responseXML.xml));
I have this jQuery script var dataString = class_id=+class_id; $.ajax({ type: POST, url: page.php,
I have the following jQuery script running on my page: <script type=text/javascript charset=utf-8 src={{
This script cannot find bannersize unless I write <div id=bannersize></div> before the javascript. The
I'm attempting to select all <script type=text/html> tags in a page. I use <script>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.