Results 1 to 8 of 8

Thread: Anyone up for this one? Dynamic Ajax Content Problem.

  1. #1
    Join Date
    May 2008
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Anyone up for this one? Dynamic Ajax Content Problem.

    1) Script Title: Dynamic Ajax Content

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

    3) Describe problem: The script works amazingly well, but a php file it loads in the content area tends to "break out" and open a new page if there are "next page" or "previous page" links within. Is there a way of modifying the Ajax Content script OR the php file it calls upon to prevent this "breakout" from occurring?

    See how the script is implemented here ->http://www.commentcollective.com

    The php script it calls upon does have the ability to display a set amount of images per page but I currently have it set to display all images in a category because of this breakout problem. If anyone could point me in the right direction to solving this problem it would be greatly appreciated. I would love to set the number of images displayed per page to 10 or so to keep the folks with slower connection speeds happy.

    I have combed this site rather extensively for an answer to this problem and have seen one or two others that are experiencing the same difficulties, but I have not found a solution in any answers that have been given. I can supply a sample of the php script if necessary.

    Thanks in advance .... PR

  2. #2
    Join Date
    Mar 2007
    Location
    Tarboro, NC
    Posts
    290
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default

    Are the links formatted like:

    Code:
    <a href="javascript:ajaxpage('test.htm', 'contentarea');">test</a>
    Or are they just normal links? If they are normal links, then just convert them to the above way. If not then please provide an example/explain better, or post your code.

    Tim

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

    PaleRider (05-06-2008)

  4. #3
    Join Date
    May 2008
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by TimFA View Post
    Are the links formatted like:

    Code:
    <a href="javascript:ajaxpage('test.htm', 'contentarea');">test</a>
    Or are they just normal links? If they are normal links, then just convert them to the above way. If not then please provide an example/explain better, or post your code.

    Tim
    Yes, the links are formatted as above and the "test.php" file loads into the content area as it should. But when a "previous page" or "next page" is clicked in the dynamic content area the breakout occurs.

    Please feel free to visit the link posted above and view the source if necessary. I really appreciate your quick reply.

    PR

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

    I don't think you understood what TimFA is saying. The links in the content area. The things that you click on to load next and previous from within the content area. Unless they are calls to load content into the content area, then of course the entire page would change.

    And, from what I understand, we can't see those links or their code because you are having the pages that load into the content area display the full page, instead of only a portion of their content.
    - John
    ________________________

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

  6. #5
    Join Date
    May 2008
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    I don't think you understood what TimFA is saying. The links in the content area. The things that you click on to load next and previous from within the content area. Unless they are calls to load content into the content area, then of course the entire page would change.

    And, from what I understand, we can't see those links or their code because you are having the pages that load into the content area display the full page, instead of only a portion of their content.
    My apologies, I did misunderstand. It was late and I had a rough Monday at work. The php script code is displayed below in it's entirety. Any help in implementing the
    Code:
    http://javascript:ajaxpage
    into this below would be great.


    As you can see, the "previous" and "next" links are set to display at the top and bottom of the dynamically generated content if a set number of images is reached. This set number is currently set at 1000 to avoid the breakout problem.

    Thanks again folks .... PR
    Last edited by PaleRider; 05-07-2008 at 11:37 AM.

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

    This is the kind of link that is 'breaking out':

    PHP Code:
    echo '<td align="left" width="38%"><a href="' $_SERVER['PHP_SELF'] . '?page=' $pre '"><b>Previous Page</b></a></td>'
    My PHP isn't the best, and I am taking TimFA's word for the javascript part, but I think if you made them all something like:

    PHP Code:
    echo '<td align="left" width="38%"><a href="javascript:ajaxpage(\'' $_SERVER['PHP_SELF'] . '?page=' $pre '\', \'contentarea\');"><b>Previous Page</b></a></td>'
    It should all work out.
    - John
    ________________________

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

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

    PaleRider (05-06-2008)

  9. #7
    Join Date
    May 2008
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    This is the kind of link that is 'breaking out':

    PHP Code:
    echo '<td align="left" width="38%"><a href="' $_SERVER['PHP_SELF'] . '?page=' $pre '"><b>Previous Page</b></a></td>'
    My PHP isn't the best, and I am taking TimFA's word for the javascript part, but I think if you made them all something like:

    PHP Code:
    echo '<td align="left" width="38%"><a href="javascript:ajaxpage(\'' $_SERVER['PHP_SELF'] . '?page=' $pre '\', \'contentarea\');"><b>Previous Page</b></a></td>'
    It should all work out.
    Thank you very much, this seems to have totally solved the breakout problem. I had tried several variants of the code you supplied, but had never nailed in spot on like you did. You say you php skills aren't the best, but they are definitely better than mine.

    If you are interested in seeing it in action go to http://www.commentcollective.com/index2.html and use the "Test" link in the Miscellaneous category on the left hand menu.

    Once again ... Thanks so much ... PR

  10. #8
    Join Date
    Mar 2007
    Location
    Tarboro, NC
    Posts
    290
    Thanks
    8
    Thanked 2 Times in 2 Posts

    Default

    Glad you got it fixed, man. Happy coding...

    Tim

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
  •