SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ajax pagination two instances on same page ?

    After some research I found solution to paging my content with ajax (php mysql). I have one index which include paging.php and this is ok, but after adding second paging2.php file after clicking on more news content apears on block which is reserved for second paging content.
    Here is page where you can see this
    http://www.eparhijazvornickotuzlanska.org/index7.php

    Notice that first and second paging file works perfectly
    separately.

    Any idea ?

  2. #2
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Your problem is that you are setting both requests to use the same function, stateChanged().

    In the first file, this writes into the correct box, however because you're creating the same function again in the second file, you're redefining the function to write into the second box.

    Simple solution. In ajax_req2.js, replace all instances of 'stateChanged' with 'stateChanged2' - do a mass replace in your editor or something. Your issue should then be fixed.
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks man, I really appreciate.

    Regards,

  4. #4
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Any time
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  5. #5
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    109
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Every random time's on accessing index page content from paging2.php is showing on both places, on left and right side of page.
    After refreshing everyting is ok. What can be a problem ?

  6. #6
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Sorry but I can't replicate that problem...
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona


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
  •