periodical AJAX request

here you can Request certain custom made Scripts in exchange for something (most likely money)

Moderator: 1.2 Moderators

periodical AJAX request

Postby erikh06 on Sat Sep 20, 2008 8:12 am

I'm looking for someone to create a small script for use with the 1.2 framework.

All I need is for a <div> to reload with a file [on the server] contents, automatically every x seconds.

I have a the script working with prototype... but it and mootools conflict with each other and can't be on the same page. :o

If you can do this... let me know by pm. Let me know how much you want for the task as well.
Last edited by daKmoR on Sat Sep 20, 2008 1:36 pm, edited 2 times in total.
Reason: wrong topic -> moved
erikh06
 
Posts: 3
Joined: Fri Sep 12, 2008 9:03 am

Re: periodical AJAX request

Postby daKmoR on Sat Sep 20, 2008 2:06 pm

hi, due to your request we created a new forum section...

pls read the forum rules "Script Request Rules" and update your post.
"Speak when you are angry and you will make the best speech you will ever regret." - Ambrose Bierce
User avatar
daKmoR
Site Admin
 
Posts: 860
Joined: Mon Jul 14, 2008 11:40 am

Re: periodical AJAX request

Postby Arian on Fri Sep 26, 2008 10:49 am

Hi,

I've created a little script to update a div periodical.

  1.  
  2. /**
  3.  * @author Arian Stolwijk
  4.  */
  5.  
  6. var reloadPeriodical = new Class({
  7.    
  8.     Implements: Options,
  9.    
  10.     options: {
  11.         time: 2000
  12.     },
  13.    
  14.     initialize : function(elmt,url,options){
  15.         this.setOptions(options);
  16.         this.elmt = $(elmt);
  17.         this.url = url;
  18.         (function(){this.request()}.bind(this)).periodical(this.options.time);
  19.        
  20.     },
  21.    
  22.     request: function(){
  23.         var myRequest = new Request({url: this.url,onComplete: function(data){
  24.             this.elmt.set('html',data);
  25.         }.bind(this)}).send();
  26.     }
  27.    
  28. });
  29.  
  30.  
Attachments
update.rar
A archive that should work ;)
(12.44 KiB) Downloaded 90 times
Arian
mootools fan
 
Posts: 70
Joined: Thu Aug 07, 2008 12:07 pm
Location: Groningen, NL

Re: periodical AJAX request

Postby lume on Fri Jun 26, 2009 1:03 pm

this is probably a question to the author of the solution. do you see an easy way to suspend the periodical reload while a user is interacting with the page? i want to update a calendar element, but especially while dragging an calendar entry around, the periodical update process is pretty disturbing.
best regards - lume
lume
 
Posts: 7
Joined: Thu Jun 11, 2009 7:07 pm

Re: periodical AJAX request

Postby Negaja on Wed Jul 01, 2009 9:18 am

Well, i can't answer your question but i want to suggest the Mootools-native methods for your needs: http://www.mootools.net/docs/more/Reque ... Periodical
Negaja
 
Posts: 2
Joined: Thu Aug 07, 2008 2:38 pm


Return to Script Request

Who is online

Users browsing this forum: No registered users and 2 guests