Uutiset:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu
Advertisement:

ajax div auto refresh

Aloittaja ricktee76, syyskuu 09, 2013, 10:17:09 AP

« edellinen - seuraava »

ricktee76

i have a function to refresh a selected div every 10 seconds, it works as a standalone but i cant get it work inside a page.
i have added the jquery for google api into the index.template head and i'm trying to call
refresh.php using the include function but i get no data.
like this:
<?php

// all other non related data

include ("refresh.php");

// the rest of the non related data


i have also tried:
<?php

// all other non related data
?>

<div id="thisdiv">Content will appear here</div>

<?php

// the rest of the non related data

should i add the ssi.php or any other variables?

All Colours Sam

If it is only a div why don't you just put it inside index.template instead of including a file?  including a file in PHP is pretty different from including a file in HTML.

Whats the exact piece of code and where do you want it to appear?
Oh, wouldn't it be great if I *was* crazy? ...then the world would be okay
Suki

ricktee76

Hi Suki, thanks for the reply.

I tried that, it loads once and doesn't refresh, but as a standalone it did.

I've solved this now. it was just the path for the include needed to be altered.
'path/to/file/file.php'

I used php because i get the content of the div from a script outside smf but display it in a custom page inside smf.

margarett

Lainaus käyttäjältä: J69ames6 - syyskuu 09, 2013, 09:28:30 IP
I'm not sure there's one in the making, at lest at this community.
Spammers? There are a LOT of them in the making, in this and other communities! :P
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

LainaaOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Advertisement: