Results 1 to 2 of 2

Thread: [RESOLVED] Never used setTimeout - having a hard time

  1. #1

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Resolved [RESOLVED] Never used setTimeout - having a hard time

    I would expect FIREBUG to break in the sprocInfo() function - after 1 second - but it never does...

    What am I doing wrong??

    Code:
    function sprocClick(sender) {
        if (g_blnInSproc) {
            alert("Do not click button twice!");
        } else {
            g_blnInSproc = true;
            var strCT = sender.currentTarget;
            var wesBtn = $(strCT);
            var strId = wesBtn.closest('.acs-ddreflector').attr("id");
            var acsSproc = wesBtn.attr("acssproc");
            ctrlWebService("acssproc=" + acsSproc, "", "", strCT);
            var t = setTimeout("sprocInfo(" + strId + ")", 1000);
        }
    }
    
    function sprocInfo(strId) {
        if (g_blnInSproc) {
            $("#" + strId + " .acs-sproc-info").not(".acs-edit-view-hidden").html('<img src="Images/ajax-loader.gif" />Processing now...');
        }
    }

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  2. #2

    Thread Starter
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: Never used setTimeout - having a hard time

    oops - missing some single quotes around my 'argument' to sprocInfo - plus I dropped it to 750 ms - most of my web services run in around 100 to 200 ms

    s/b var t = setTimeout("sprocInfo('" + strId + "')", 750);

    Code:
    function sprocClick(sender) {
        if (g_blnInSproc) {
            alert("Do not click button twice!");
        } else {
            g_blnInSproc = true;
            var strCT = sender.currentTarget;
            var wesBtn = $(strCT);
            var strId = wesBtn.closest('.acs-ddreflector').attr("id");
            var acsSproc = wesBtn.attr("acssproc");
            ctrlWebService("acssproc=" + acsSproc, "", "", strCT);
            var t = setTimeout("sprocInfo('" + strId + "')", 750);
        }
    }
    
    function sprocInfo(strId) {
        if (g_blnInSproc) {
            $("#" + strId + " .acs-sproc-info").not(".acs-edit-view-hidden").html('<img src="Images/ajax-loader.gif" />Processing now...');
        }
    }

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width