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

  • SEARCH
  • Home
  • 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 8178159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:41:46+00:00 2026-06-06T23:41:46+00:00

I wrote a script to hide and show a loader for my asp.net web

  • 0

I wrote a script to hide and show a loader for my asp.net web application. The script works great when placed inline. I tried to extract the script to an external file and received the following error:

Error: The value of the property ‘Pausing’ is null or undefined, not a Function object

I tried to look up the error, but I was unable to find a solution to the problem. I am new to asp.net so it may be that I’m not sure how to search for the right question.

My inline code that works is:

<script type="text/javascript">

    function Pausing() {
        window.setTimeout(ShowLoader, 1);
    }

    function ShowLoader() {
        if ((typeof Page_IsValid === 'undefined') || 
            (Page_IsValid != null && Page_IsValid)) {
            var i = document.getElementById("loader");
            var img = document.getElementById("img");
            i.style.display = "block";
            setTimeout("document.images['img'].src=document.images['img'].src", 10);
            Endpausing();
        }
    }

    function HideLoader() {
        var i = document.getElementById("loader");
        i.style.display = "none";
    }

    function Endpausing() {
        window.setTimeout(HideLoader, 4000);
    }
</script>

The event call is attached to an asp:button control below:

<asp:Button ID="btnGetReport" runat="server" OnClick="btnGetReport_Click" OnClientClick="Pausing();" />

I removed the inline script and replaced with this…

<script type="text/javascript" src="../../Scripts/Loader.js"></script>

Added script to external file:

window.onload = initAll;

function initAll() {

    function Pausing() {
        window.setTimeout(ShowLoader, 1);
    }

    function ShowLoader() {
        if ((typeof Page_IsValid === 'undefined') ||      // asp page has no validator
                (Page_IsValid != null && Page_IsValid)) {
            var i = document.getElementById("loader");
            var img = document.getElementById("img");
            i.style.display = "block";
            setTimeout("document.images['img'].src=document.images['img'].src", 10);
            Endpausing();
        }
    }

    function HideLoader() {
        var i = document.getElementById("loader");
        i.style.display = "none";
    }

    function Endpausing() {
        window.setTimeout(HideLoader, 4000);
    }
}

Then I receive the previously mentioned error.

Any help would be greatly appreciated!

  • 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-06T23:41:47+00:00Added an answer on June 6, 2026 at 11:41 pm

    Always use ResolveUrl to call your script files like this

    Lets assume your script is in Script folder of your root path with a file Name as MyScriptFile.js

     <script type="text/javascript" src="<%= ResolveUrl ("~/Scripts/MyScriptFile.js") %>"></script>  
    

    EDIT : you can use ResolveUrl or ResolveClientUrl based on your needs

    ResolveUrl creates the URL relative to the root where as
    ResolveClientUrl creates the URL relative to the current page.

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

Sidebar

Related Questions

I wrote this script to for a contact form on my website, everything works
<script type=text/javascript> $(document).ready(function() { $(#credit_pay).hide(); $(#downpayment_method).change(function() { if ($(#downpayment_method).val()=='credit_card') { $(#credit_pay).show(fast); } else {
I have script like this : $(#addk).bind(click, function(event){ //alert(here!); $(#loader-overlay).show(); $.ajax({ 'async':False, 'type': POST,
I have found a great tutorial on how to show and hide a certain
I wrote this jQuery script. It works somewhat OK. I want this fly out
I wrote some script in a site. The script makes a new spreadsheet and
I wrote a script parsing a .csv file in groovy using tokenize, which ended
I wrote this script which counts occurrences of particular pattern in a given file.
I wrote a script that uses xcodebuild to generate an AdHoc build of an
I have wrote a script to detect when I reach the div element which

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.