That unfortunately seemed to kill the whole script, not just the first page.
I tried changing the following (new text in red)
Code:
if (this.pageinfo.pages.length>0 && selectedpage>0){
var ajaxfriendlyurl=this.pageinfo.pages[selectedpage].replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/")
ajaxpageclass.connect(ajaxfriendlyurl, this.divId) //fetch requested page and display it inside DIV
}
which worked when the page was initially loaded, but when you click to the second page and return to the first page, it won't clear the content.
Then I thought I could maybe insert an extra DIV to only be visible when the first page is selected
Code:
<div id="paginate-top"> </div>
<div id="bookcontent"> </div>
<div id="basiccontent">This is the original content for page 1 </div>
<div id="paginate-bottom"> </div>
and somewhere in the javascript put
Code:
if (selectedpage==0){
document.getElementbyId('bookcontent').style.display = "none"
document.getElementbyId('basiccontent').style.display = ""
}
if (selectedpage>0){
document.getElementbyId('bookcontent').style.display = ""
document.getElementbyId('basiccontent').style.display = "none"
}
but this seemed to just kill the javascript entirely, or do nothing at all, depending on where I put it in the script.
Is there something wrong with my final bit of code (I really don't know javascript much) or is there a specific place I can put it where it should work?
Bookmarks