Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Ajax Includes script problems

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

    Default Ajax Includes script problems

    Hi,

    Ajax Includes
    http://www.dynamicdrive.com/dynamici...axincludes.htm

    first of all, thank you for the script It has been extremely helpful, however I have encounted a problem with the Ajax Includes Script. I use the script on this page:

    www.themilewall.com/maintest.htm

    I have included multiple html pages into a single one in order to make the content load sequentially. When I got to about seven of these:

    <script type="text/javascript">
    ajaxinclude("example.html")
    </script>

    The external pages started to squash and all the content would line up. If you scroll across the above page you can see an example of this. Any insight into why it is doing this would be immensely helpful.

    Thank you for your time.

    -Travis

  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

    Looks like you hit a 'wall' (pun intended). Actually, this is not a problem in NS8 (FF mode) but, there your measuring stick graphic below the images does not show, though the 'mile' markers do. I see what you mean in IE. This is most likely either a layout problem or some intrinsic limitation for IE. How are you setting the width of the page? Have you tried setting up a train of images that long on a plain page without includes? You might have better luck if your overall layout was a table row that you kept adding cells to.
    - John
    ________________________

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

  3. #3
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    I noticed that you're calling the Ajax include script as follows:

    Code:
    <script type="text/javascript">
    onLoad=ajaxinclude("section3.html")
    </script>
    You'll need to remove the "onLoad=" code, since this script cannot be called after the page has loaded- it needs to be called directly. I suspect this is the source of your problems...

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Quote Originally Posted by John
    Looks like you hit a 'wall' (pun intended).
    Oh, dear.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Jan 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thanks for responding,

    Yes I have hit a wall ! I don't think it has anything to do with the onLoad I added but now I know that it doesn't change anything so I'll take that out! It was doing its sqaush thing before I added that.

    The original page was set up without an includes script, however because of it's abnormal horizontal orientation, the page loads backwards. You can see how slow the normal way is at,

    www.themilewall.com

    I've tried everyway of including and setting the length I could think of, Tables worked, and did not squash content, but then they overlapped and some of the content below was unclickable. Is there some sort of limit to the amount of includes you can have on one page? Thanks for the help troubleshooting!

    -Travis

  6. #6
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Wow, you're including a lot of content dynamically. In such instances, you're really pushing the limits of doing this client side, such as by using the Ajax Includes script. BTW, using "onload" definitely won't work, which you still have one remaining on your page.

    Back to the issue though, do you have access to something like SSI (server side includes) or PHP on your server> If so, using server side to include the content instead of forcing the user browser to do this work would definitely be much better here.

  7. #7
    Join Date
    Jan 2006
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Yes I have access to both SSI and PHP, and I like PHP a heck of alot better than JavaScript, but how can I do this same thing with php? I really am not sure how SSI works at all doesn't it use JavaScript as well?

    I wanted to make the page load piece by piece, or at least have the front part of the page load first and then have the rest load, which is why I thought the synchronous Ajax would help, can I accomplish this same thing with a <?php include 'example.html' ?>?

    Thanks again for the help, I really appreciate it, if you have a small logo I would be more than happy to add it to the wall.

    Thanks,

    Travis

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    I wanted to make the page load piece by piece, or at least have the front part of the page load first and then have the rest load, which is why I thought the synchronous Ajax would help, can I accomplish this same thing with a <?php include 'example.html' ?>?
    Yes.
    SSI stands for Server-Side Includes, and so obviously doesn't use a client-side language like Javascript. I think to include a file using SSI is something like
    Code:
    <!-- #include file="example.html" -->
    I'm probably wrong.
    Last edited by Twey; 01-16-2006 at 08:50 PM.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Is the page itself PHP or SSI enabled? For example, is the extension .php or .shtml?

    You can't load and display content sequentially using any server side language. However, one solution is to use a script like Sequential Content loader and inside the DIV tags, embed the external content using PHP or SSI...

  10. #10
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You can't load and display content sequentially using any server side language.
    Wrong.
    PHP Code:
    <?php
      
    for($i=0;$i<=256;$i++) echo(" "); // Output 256 spaces for Internet Explorer.
      
    include($file1); // Include the file.
      
    ob_flush(); // Flush any extra output buffer that may be running.
      
    flush(); // Flush the main (top-level) output buffer.
    ?>
    It's not too reliable, but it's possible.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •