PDA

View Full Version : ajax paginate not working on firefox 2.0



frank1
08-28-2008, 02:05 PM
well
i am doing this


<script type="text/javascript">

var bookonflowers={
pages: [<?php
for ($i=0; $i<$total_pages; $i++)
{ $start = $display * $i;
if ($i==0)
{
echo "\"fetchallusersphotos.php?block=1&start=$start&display=$display\"";
}
else
{
echo ",\"fetchallusersphotos.php?block=1&start=$start&display=$display\"";
}
}?>],
selectedpage: 0 //set page shown by default (0=1st page)
}


var bookonanimals={
pages: [<?php
for ($i=0; $i<$total_pages1; $i++)
{ $start1 = $display * $i;
if ($i==0)
{
echo "\"fetchallusersphotos.php?block=2&start=$start1&display=$display\"";
}
else
{
echo ",\"fetchallusersphotos.php?block=2&start=$start1&display=$display\"";
}
}?>],
selectedpage: 0 //set page shown by default (0=1st page)
}

on this
http://www.dynamicdrive.com/dynamicindex17/ajaxpaginate/index.htm

but it works fine on IE6 but it fails in firefox
ie
first tabset shows

but when i click on second tab(animal..)..though it has some contents it shows same old content of tab 1 (flower..)

so what kind be matter with it...
thanks

ddadmin
08-28-2008, 11:51 PM
We need to see the actual rendered page. Please post a link to the page on your site that contains the problematic script so we can check it out.

frank1
08-29-2008, 08:41 AM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<link rel="stylesheet" type="text/css" href="../css/ajaxpagination.css" />

<script src="../ajaxpagination.js" type="text/javascript">

/***********************************************
* Ajax Pagination script- (c) Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

</script>
</head>

<body>
<ul>
<li><a href="javascript:mybookinstance.refresh(bookonflowers)">Your Personal Photos</a></li>
<li><a href="javascript:mybookinstance.refresh(bookonanimals)">Photo Posted by You</a></li>
<li><a href="javascript:mybookinstance.refresh(bookcombo)">All Events Photos </a></li>

</ul>

<div id="paginate-top"> </div>
<div id="bookcontent"> </div>
<div id="paginate-bottom"> </div>

<p><a href="javascript:mybookinstance.selectpage(1)">Select 2nd page dynamically</a></p>

<script type="text/javascript">

var bookonflowers={
pages: ["fetchallusersphotos.php?block=1&start=0&display=2","fetchallusersphotos.php?block=1&start=2&display=2"],
selectedpage: 0 //set page shown by default (0=1st page)
}


var bookonanimals={
pages: ["fetchallusersphotos.php?block=2&start=0&display=2"],
selectedpage: 0 //set page shown by default (0=1st page)
}

var bookcombo={
pages: ["demofiles/flower.htm", "demofiles/flower2.htm", "demofiles/flower3.htm", "demofiles/flower4.htm", "demofiles/external.htm", "demofiles/external2.htm", "demofiles/external3.htm", "demofiles/flower.htm", "demofiles/flower2.htm", "demofiles/flower3.htm", "demofiles/flower4.htm", "demofiles/external.htm"],
selectedpage: 0 //set page shown by default (0=1st page)
}

var mybookinstance=new ajaxpageclass.createBook(bookonflowers, "bookcontent", ["paginate-top", "paginate-bottom"])

</script>



</body>

</html>

Well i have not used third tab...
i am using first and second tab

first tab works fine but when i click on second tab bookonanimals the content from the first tab shows...with 1-2 pages....
and when i click on page 1 only then the content of tab2 is shown.....

it works well with IE.....
i think it has some thing to do with cache....
any way thanks

frank1
08-29-2008, 01:42 PM
well
the main problem seems to be this

the content of 1st tab of first one...ie 1st content of book...
seems to be cached by the browsers.....

even in IE if i delete the first one column from the database....and hit refresh the row(content) is still shown..
though it actually is not in database or has been deleted

so content seems to be coming from cache....

if i close browser and open it in new window then only the deleted row is not seen

in js term i think it is session only persistence so how can i disable it....this is my thinking ...i dont know much of js...
will be g8 if somebody looks in both above files and sort out the problem...

frank1
08-29-2008, 01:55 PM
i think the first was not that clear any way
of this
<li><a href="javascript:mybookinstance.refresh(bookonflowers)">Your Personal Photos</a></li>
<li><a href="javascript:mybookinstance.refresh(bookonanimals)">Photo Posted by You</a></li>
<li><a href="javascript:mybookinstance.refresh(bookcombo)">All Events Photos </a></li>



your personal photos(bookonflowers) loads fines and pagination also works

but when i click photo posted by you (bookonanimals) the first one ie booksonflowers tab set comes.... with 2 pages..with second page loaded...rather than new content of 2nd tab set (bookonanimals)

i saw final line is like this
var mybookinstance=new ajaxpageclass.createBook(bookonflowers, "bookcontent", ["paginate-top", "paginate-bottom"])

...flowers ...is it causing problems

thanks

ddadmin
08-29-2008, 05:19 PM
If the problem is due to IE caching the settings variable, inside the .js file, try setting the following line to true:


ajaxpageclass.ajaxbustcache=true // Bust cache when fetching pages?

frank1
08-30-2008, 02:29 AM
If the problem is due to IE caching the settings variable, inside the .js file, try setting the following line to true:


ajaxpageclass.ajaxbustcache=true // Bust cache when fetching pages?

well thanks it did solved the IE problem ...

but that firefox problem is still on
any way this is what happens
<li><a href="javascript:mybookinstance.refresh(bookonflowers)">Your Personal Photos</a></li>
<li><a href="javascript:mybookinstance.refresh(bookonanimals)">Photo Posted by You</a></li>
<li><a href="javascript:mybookinstance.refresh(bookcombo)">All Events Photos </a></li>



bookonflowers has 6 photos for now...i am displaying two photos on each tab

when i open it in firefox ...it loads and all 3 pages (pagination,both on top and button) appers and works


now the bookonanimals ie photo posted by you there is only one photo for now....

and when i click that ...the upper pagination says...1 of 1 ...(as there is only one photo)...but the last clickced tab of the first group ie bookonflowers is displayed and lower pagination still shows 3 pages (that is of first group ie bookonflowers but it should have been one of one and displayed new photo...)

so where is problem ....it is making me difficult to trace it as it is working fine on IE....

please help...
i think it is almost done now
thanks

ddadmin
08-30-2008, 06:23 AM
So is the problem with Firefox exactly the same as with IE (before enabling cache busting solved it for the later)? In other words, does it look like a caching issue as well in FF?

frank1
08-30-2008, 08:41 AM
So is the problem with Firefox exactly the same as with IE (before enabling cache busting solved it for the later)? In other words, does it look like a caching issue as well in FF?

ya
as i have been saying
it is working fine in IE...
the problem is with firefox only i am using ff 2.0 i am using ie 6

in ie it is working fine...

thanks

ddadmin
08-31-2008, 05:23 AM
Well, from the script's perspective, it's basically done all it could to bust cache of the fetched page already when you set ajaxpageclass.ajaxbustcache to true. If it's still returning cached data, you will need to look at the server side for additional help. A quick search on PHP no cache (http://www.google.com/search?q=php+no+cache&sourceid=navclient-ff&ie=UTF-8&rlz=1B3GGGL_enCA244CA244) on Google.

frank1
08-31-2008, 10:34 AM
Well, from the script's perspective, it's basically done all it could to bust cache of the fetched page already when you set ajaxpageclass.ajaxbustcache to true. If it's still returning cached data, you will need to look at the server side for additional help. A quick search on PHP no cache (http://www.google.com/search?q=php+no+cache&sourceid=navclient-ff&ie=UTF-8&rlz=1B3GGGL_enCA244CA244) on Google.

well thanks for all help

any way rather than that ...are there any examples powered by php+mysql(this script using php+mysql)...
any such links....

it will be easier for me....

and more over i have made another script myself...with two ajax ...first ajax giving category and an ajax page fetching category data in paginated way itself...it is working fine till now in ie and ff

any way thanks...i am trying to use this script in some part of my website...if this problem is not solved i think i should replace this script as about 25% of our visitors use firefox...

any way thanks