You are not logged in.

  • Login

1

Monday, June 16th 2008, 6:27pm

DIV nach X Sekunden aktualisieren

Heyho,

ich moechte gerne ein DIV mittels Ajax nach 30 Sekunden aktualisieren lassen mit dem zurueckgegebenen Wert in einer PHP-Datei. Prototype klappt einfach leider nicht. Habt ihr vllt. ne andere Moeglichkeit? =)

Liebe Grueße und danke schonmal,
waerp

2

Monday, June 16th 2008, 6:55pm

Hi,

willst du einmal nach 30 Sekunden aktualisieren brauchst du setTimeout().
Willst du alle 30 Sekunden aktualisieren brauchst du setInterval()

siehe http://de.selfhtml.org/javascript/objekte/window.htm

3

Monday, June 16th 2008, 6:58pm

also so:

JavaScript Code

1
2
3
4
5
6
7
function init() { 
new Ajax.PeriodicalUpdater('mainmenu', 'notification.php', { 
method: 'get', parameters: 'nick={NICK}&sessionid={SID}&nh={NH}'
}); 
} 
window.onload = init;
window.setInterval("init()", 30000);

4

Tuesday, June 17th 2008, 10:07am

nein, entweder den PeriodicalUpdater oder den Intervall.

5

Tuesday, June 17th 2008, 8:35pm

also so? -g-

JavaScript Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function init() { 
   //new Ajax.Updater('mainmenu', 'notification.php?nick={NICK}&sessionid={SID}&nh={NH}', { method: 'get' }); 
   //new Ajax.Updater('mainmenu', 'notification.php', {   parameters: { nick: $F('{NICK}'), sessionid: $F('{SID}'), nh: $F('{NH}')  } });
 
new Ajax.Updater('mainmenu', 'notification.php', {
  method:'get',
  parameters:
  { 
  nick: '{NICK}',
  sessionid: '{SID}',
  nh: '{NH}'
  }
  }); 
} 
window.setInterval("init()", 10000);

6

Wednesday, June 18th 2008, 10:43am

ja

btw: gewöhne dir für die nächsten Postings das Syntax Highlighting an - Buttons sind unter dem Text-Eingabefeld.

Similar threads

Social bookmarks