PDA

View Full Version : Problem integrating interstitial content box and ajax pagination script



Bingo
05-17-2008, 12:13 AM
1) Script Title: Interstitial Content Box / Ajax pagination script

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/interstitial.htm / http://www.dynamicdrive.com/dynamicindex17/ajaxpaginate/index.htm

3) Describe problem: I'm trying to integrate the two scripts above so that within the interstitual box I can use the Ajax pagination script. I've been having some trouble with this and my knowledge of javascript is unfortunately limited so while I've been tinkering around I've not really got far.

Here is my code so far. Below is the main page from which the interstial content box is called.

<link rel="stylesheet" type="text/css" href="interstitial.css" />

<script type="text/javascript" src="interstitial.js">
/***********************************************
* Interstitial Content Box- 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>

<title>Test page</title>
WALL OF TEXT

Now originally the page this called up in the box simply had the code for the Ajax pagination script right on it but for some reason this wouldn't load. I tried a lot of things but nothing would work, for some reason the ajax pagination script just simply would literally not load inside the interstitial content box. I could write other things on that page outside of the pagination script and they would show, but nothing to do with the pagination script would show!

So my next attempt was to get the intersititial content box to load an iframe and the iframe would point to the page with the ajax pagination script on it. Success! But only in Opera! I try in Internet Explorer and the interstitial content box loads but doesn't show the ajax pagination script. Instead I get a javascript error telling me "'null' is null or not an object". Firefox will only load the content box and not the pagination script, too.

The iframe file contains the following code:

<iframe src="http://www.mysite.com/page.php" style="width: 100%; height: 500px" marginwidth="0" marginheight="0" frameborder="0" vspace="0" hspace="0" scrolling="no"></iframe>

page.php contains:

<link rel="stylesheet" type="text/css" href="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>
<div id="paginate-top"> </div>

<div id="pcontent"> </div>

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

<script type="text/javascript">

var myajaxbook={} //arbitrary variable to hold page settings for this book
myajaxbook.page=["pageone.php", "pagetwo.php", "pagethree.php"]
myajaxbook.selectedpage=0 //set page shown by default (0=1st page)

var mypages=new ajaxpageclass.bindpages(myajaxbook, "pcontent", ["paginate-top", "paginate-bottom"])

</script>

Could anyone help me with this? I hope I've explained it sufficiently well. The script seems to work fine in only Opera. Neither Firefox or Internet Explorer work. Could someone offer help :) ?

Thanks

ddadmin
05-19-2008, 12:38 AM
Continued here: http://www.dynamicdrive.com/forums/showthread.php?t=32583