Results 1 to 3 of 3

Thread: Page Loading Script for large content

  1. #1
    Join Date
    Sep 2004
    Location
    Tallahassee, FL USA
    Posts
    264
    Thanks
    71
    Thanked 2 Times in 2 Posts

    Default Page Loading Script for large content

    Hello,

    I'm creating a section for a school website that will list over 9,000 book titles in four different categories (by Title, by Author, by Book Level, and by Points).

    The content is shown in a div and called and loaded via Ajax.

    Here is the test page: http://www.gilchrist.leon.k12.fl.us/ar/artest.html
    After you click "Go" when the drop down menu is displaying By Book Title, the content loads in the div in a few moments.

    Here is the content page that appears in the div after you click "Go": http://www.gilchrist.leon.k12.fl.us/...stByTitle.html

    If possible, I need a "page loading..." script that will appear only after you click "Go" while the list of books is being loaded.

    I've been testing different ones I've found online, but can't get any to work. Of course, I'm not even sure if the script would be added to artest.html, 1112-QuistListByTitle.html, or a combination of both...

    Any help with this would be greatly appreciated.

    Thank you,
    Deborah
    Deborah Whipp
    Web Designer
    Tallahassee, FL
    www.DWWebDesigns.com

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I don't think you need anything so elaborate as a separate script.

    First download this image:

    Name:  spinningred.gif
Views: 2095
Size:  3.2 KB
    http://www.dynamicdrive.com/dynamici...pinningred.gif

    and put it in the same folder as the artest.html page. Then here on artest.html where you have:

    Code:
    <script type="text/javascript">
    /***Combo Menu Load Ajax snippet**/
    function ajaxcombo(selectobjID, loadarea){
    var selectobj=document.getElementById? document.getElementById(selectobjID) : ""
    if (selectobj!="" && selectobj.options[selectobj.selectedIndex].value!="")
    ajaxpage(selectobj.options[selectobj.selectedIndex].value, loadarea)
    }
    </script>
    Change it to:

    Code:
    <script type="text/javascript">
    /***Combo Menu Load Ajax snippet**/
    function ajaxcombo(selectobjID, loadarea){
    	var selectobj=document.getElementById? document.getElementById(selectobjID) : "";
    	if (selectobj!="" && selectobj.options[selectobj.selectedIndex].value!=""){
    		document.getElementById(loadarea).innerHTML = '<img src="spinningred.gif" style="margin: 0 auto; display: block; width: 32px; height: 32px;" alt="Loading" title="">';
    		ajaxpage(selectobj.options[selectobj.selectedIndex].value, loadarea);
    	}
    }
    </script>
    That's it!
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    dmwhipp (05-15-2011)

  4. #3
    Join Date
    Sep 2004
    Location
    Tallahassee, FL USA
    Posts
    264
    Thanks
    71
    Thanked 2 Times in 2 Posts

    Smile Thank you!

    Simple, elegant and working perfectly! I've been testing different scripts and solutions for two days, and once again you solve my problem.

    Many thanks,
    Deborah
    Deborah Whipp
    Web Designer
    Tallahassee, FL
    www.DWWebDesigns.com

Bookmarks

Posting Permissions

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