Results 1 to 8 of 8

Thread: Dynamic Ajax Content Load State

  1. #1
    Join Date
    Feb 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Dynamic Ajax Content Load State

    1) Script Title: Dynamic Ajax Content Load State

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...jaxcontent.htm

    3) Describe problem: This script is really awesome and it works great, but I have a slight problem. I have it loading in a table with many pages being called in to the container (not all at once...lol) Some pages require overflow:auto and this is where the problem comes in. Let's say I scroll down to the bottom of any of my loaded pages within the container area and then go up to my navigation and choose another page to go to it loads from the previous pages state, meaning that it loads the new page as if I had already scrolled to the bottom of it. Is there a way around this?

    Thanks for a great script...will definitely give you guys a back link on my site.

    Thanks Nic

  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'm not sure I understand completely or, even if I do if this will fix it but, it is worth a shot:

    Code:
    <a href="javascript:ajaxpage('test.htm', 'contentarea');" onmouseup="window.scrollTo(0,0);">test</a>
    - John
    ________________________

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

  3. #3
    Join Date
    Feb 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Thanks, but id did not work

    Hi,

    The code that you gave me looked like it would do the trick but didn't. Think you might have a better idea of what the problem really is if you check the functionality of the page.

    www.defyinggravity.co.za/home2.html

    Scroll down on any page and then use the navigation to select another page. You will see it loads from the previous pages position. This only happens in IE, NS and Opera. Firefox as we all know is perfect...lol

    Thanks for the help

  4. #4
    Join Date
    Feb 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Talking ooops! title wrong it not id

    Sorry hope that did not send you on another tangent

  5. #5
    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 thought it was the page but, looks like it is the division and maybe that wasn't so much a typo as it was you being psychic. Give this a shot:

    Code:
    <a href="javascript:ajaxpage('test.htm', 'contentarea');" onmouseup="document.getElementById('rightcolumn').scrollTop=0);">test</a>
    Also, this is causing an error:

    Code:
    <body onload="MM_preloadImages('Light.jpg')" tracingopacity="50">
    Apparently MM_preloadImages is undefined. Either define it or remove the call for it onload.
    - John
    ________________________

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

  6. #6
    Join Date
    Feb 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Hmmmm

    Thank you so much for the effort so far and for the tip on the MM_load. To be perfectly honest I am about 99.99993378564% code illiterate so this has been interesting to say the least.

    I have tried both option you gave me, I even tried making 2 links at the bottom of the page home6.html to see if it wasn't the menus but no still joy. I am wondering if it is not supposed to happen in the script or am I just showing how clueless I am?

    Or are there other possibilities? Quantum physics seems easier to understand than this...lol

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

    You could try adding it here instead -

    Replace:

    Code:
    function loadpage(page_request, containerid){
    if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
    document.getElementById(containerid).innerHTML=page_request.responseText
    }
    with:

    Code:
    function loadpage(page_request, containerid){
    if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
    {
    document.getElementById(containerid).scrollTop=0;
    document.getElementById(containerid).innerHTML=page_request.responseText
    }
    }
    It did work here locally if I pasted the command into the address bar.
    - John
    ________________________

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

  8. #8
    Join Date
    Feb 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Yeah!!!!

    John you are a scholar and a gentleman, it is working perfectly now...thank you for your amazing help!

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
  •