Including Gbook in another page with AJAX

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
colinch
Posts: 2
Joined: Fri Jan 03, 2014 10:40 pm

Including Gbook in another page with AJAX

Post by colinch »

Using version 1.7

I'm trying to show the gbook comments on another page by loading the gbook.php in another div using jQuery.

I'm using the following script:

Code: Select all

<script>
       $("#siteloader").load("../gbook/gbook.php");
</script>
It seems like it's only working for my IP address. On all my devices, on all browsers; it's working.
When viewing the page in someone else's house or using a web proxy, the #sideloader div doesn't load the comments.

I hope someone can help me with this, the script is amazing.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Re: Including Gbook in another page with AJAX

Post by Klemen »

It won't work like that, GBook was designed as a stand-alone script and in prints out full HTML code with all the headers and tags.

The easiest way to include it in your page directly would probably be to use an iframe.

If you want direct inclusion you would have to completely modify the template files.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
colinch
Posts: 2
Joined: Fri Jan 03, 2014 10:40 pm

Re: Including Gbook in another page with AJAX

Post by colinch »

Thanks for your reply!

I will try to use an iframe.

But what thing in the template files is preventing me from displaying it? Because it does work on all my own devices, but when other people try it, it doesnt work.
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Re: Including Gbook in another page with AJAX

Post by Henrie »

But what thing in the template files is preventing me from displaying it? Because it does work on all my own devices, but when other people try it, it doesnt work.
I never used JQuery so my following comment might be stupid and also at your supplied code with relative path it does not look like my following comment is the case,
but....

maybe somehow the link to the template files is pointing to some local files which are not available from outside computers?

Greetings,
Henrie
I do not monitor the Gbook forums regularly anymore since I do not use the Gbook script myself anymore for a long time. But it helped me a lot in learning to understand php.
Post Reply