Results 1 to 6 of 6

Thread: Dynamic Ajax content - Loading Box

  1. #1
    Join Date
    Apr 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Dynamic Ajax content - Loading Box

    Dynamic Ajax Content

    http://www.dynamicdrive.com/dynamici...jaxcontent.htm

    I'm using this script on my website. It's cool, but I need 1 more thing. Can it be posible to show a "Loading Page Box" when it's loading the new page on the iframe.

    Thank you!

  2. #2
    Join Date
    Apr 2006
    Posts
    190
    Thanks
    3
    Thanked 7 Times in 7 Posts

    Default

    its not an iframe.

    But yes a Loading Page Indicator would be nice.

  3. #3
    Join Date
    Apr 2006
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Loading image.

    I would like to know how to add a "loading image" or some text that simply says "Page Loading" to the Dynamic Ajax Content script.
    I am loading php pages with sql qurries that take some time to process.
    Any ideas or links to a tutorial would be appreciated.
    This script is exactly what I need if it could show some kind of status indicator.
    Thanks,
    zee

  4. #4
    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

    Without testing but, using my knowledge of DHTML scripting, I'd try changing this:

    Code:
    page_request.onreadystatechange=function(){
    loadpage(page_request, containerid)
    }
    to:

    Code:
    document.getElementById(containerid).innerHTML='Loading Page'
    page_request.onreadystatechange=function(){
    loadpage(page_request, containerid)
    }
    The part:

    Code:
    Loading Page
    could be HTML, if desired:

    Code:
    <table align="center" width="100%" height="100%"><tr><td align="center" valign="middle" width="100%" height="100%">Loading Page</td></tr></table>
    This would work well with a container for the content that is, say - a division with a set width and height.
    Last edited by jscheuer1; 04-26-2006 at 04:39 PM.
    - John
    ________________________

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

  5. #5
    Join Date
    Apr 2006
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Thanks to jscheuer1

    The line of code you offered worked great!
    Thanks jscheuer1.

    I found this site to make a quick animated gif: (easy, but you can make your own)
    http://www.ajaxload.info/

    I changed the line you offered to:
    Code:
    document.getElementById(containerid).innerHTML='<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td width="49%" class="LoadingDataLeft">Hang On&hellip; </td><td width="2%" align="center" valign="middle"><img src="/loadingdata.gif" alt="LoadingData" width="32" height="32" /></td><td width="49%" class="LoadingDataRight">Loading Data&hellip; </td></tr></table>'
    Works Great!

  6. #6
    Join Date
    Apr 2006
    Posts
    190
    Thanks
    3
    Thanked 7 Times in 7 Posts

    Default

    Awsome thanks

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
  •