Loading...
Ajax

Updater avec JQuery du contenu à jour

Voici un plugin JQuery utile pour mettre à jour du contenu périodiquement.

A télécharger ici

Step 1 –  jQuery et le plugin.

<script src="jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="jquery.periodicalupdater.js" type="text/javascript"></script>

Step 2 – le script d’appel

$(document).ready(function(){
   $.PeriodicalUpdater({
      url : 'random.php'
   },
   function(data){
      var myHtml = 'The data returned from the server was: ' + data + '';
      $('#results').append(myHtml);
   });
})

Liste des options:

url
URL appel ajax de votre fonction php

method
GET ou POST!)

sendData
Tableau des valeurs envoyées à la page

minTimeout
valeur de départ de timeout en millisecondes.

maxTimeout
durée Maximum du temps entre deux requêtes.

multiplier
coefficient multiplicateur entre deux requêtes

type
Type de la réponse : text, xml, json etc – .

Step 3 – Arrêter les requêtes!

le script

$('a#stop').click(function(e){
   e.preventDefault();
   clearTimeout(PeriodicalTimer);
})
14 comments
  1. golden goose sneakers

    I want to convey my love for your generosity for those people that must have help on this important area of interest. Your special commitment to getting the solution all around ended up being pretty interesting and has enabled workers like me to get to their objectives. Your amazing important information denotes this much to me and even further to my office workers. Thank you; from each one of us.

  2. westbrook shoes

    I would like to express my love for your generosity supporting individuals that must have help with in this niche. Your personal commitment to passing the solution throughout came to be astonishingly helpful and has truly enabled individuals just like me to attain their desired goals. Your valuable tutorial means a lot a person like me and especially to my peers. Thank you; from everyone of us.

  3. giannis shoes

    I simply desired to say thanks all over again. I am not sure what I would’ve undertaken without the actual strategies contributed by you on my question. Certainly was a very fearsome dilemma for me personally, but being able to view a new expert mode you dealt with the issue took me to cry over gladness. I’m just happy for this help and have high hopes you are aware of an amazing job you happen to be putting in educating men and women thru a web site. Most probably you haven’t come across any of us.

  4. supreme

    My wife and i got now glad when Peter managed to complete his preliminary research because of the precious recommendations he grabbed using your blog. It is now and again perplexing just to always be giving freely procedures which some people might have been trying to sell. And we also grasp we need the writer to be grateful to because of that. Those illustrations you’ve made, the easy website menu, the relationships you can make it easier to engender – it’s got all exceptional, and it’s really making our son in addition to the family feel that that subject matter is awesome, and that is rather essential. Thank you for all!

  5. bape

    I wanted to send you one very small word in order to say thank you over again for these pleasing opinions you’ve featured above. It is simply incredibly generous with you to make unhampered all that most of us would’ve offered for sale as an e book to get some bucks for their own end, most importantly considering that you might well have done it if you considered necessary. The ideas in addition served to become a good way to be sure that someone else have a similar desire much like my own to realize significantly more on the topic of this condition. I think there are a lot more enjoyable periods in the future for folks who check out your site.

  6. lebron 18

    I must show my thanks to you just for rescuing me from such a challenge. Right after surfing around through the search engines and obtaining things that were not helpful, I figured my life was over. Existing without the approaches to the difficulties you have sorted out by way of this guideline is a crucial case, as well as ones which may have badly damaged my career if I hadn’t encountered the website. Your own skills and kindness in maneuvering all the things was valuable. I don’t know what I would have done if I had not come across such a step like this. I can also now look forward to my future. Thanks for your time so much for your professional and amazing help. I will not hesitate to endorse the sites to anyone who desires guide on this topic.

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *