Saturday, November 5, 2011

Smartupdater 4.0.beta is released


http://www.eslinstructor.net/smartupdater/

New features:  100%-jQuery API style.
No new functionality was added in this release. Only new API and coding style were implemented.

12 comments:

  1. Hi,

    How would you add a script so that you call a PHP script that gets information from a Database, a bit like the Facebook wall(it updates after a couple of minutes with new posts) ?

    ReplyDelete
  2. Hi Anonymous,

    please take a look at the Smartupdater's home page

    http://www.eslinstructor.net/smartupdater/

    there are a lot of examples. Simply click on the [view code] link under blue area and see actual code of the example.

    Most basic usage is:

    $("#example1").smartupdater({
    url : 'http://yourPhpScript.php',
    minTimeout: 120000 // 120 seconds
    }, function (data) {
    $("#example1").html(data);
    }
    );

    Please let me know if you still have problem with this plugin.

    Thanks,

    -Vadim

    ReplyDelete
  3. hi Vadim

    i love your plugin but i have a problem

    i set a div to use smartupdater to get data from the server at a interval
    on hover over the div i want to pause smartupdater
    if i use start and restart everytime the user hovers out i get a new request
    any wait i can pause smartupdater ?

    regards,
    ionut

    ReplyDelete
  4. Hi Ionut,

    I'm not sure I completely understand your question, but if you ask how to stop and re-start smartupdater:

    $("#example1").smartupdater("stop");
    $("#example1").smartupdater("restart");

    You can also take a look at
    http://www.eslinstructor.net/smartupdater/
    "Documentatin" section and "Stop/Restart" example

    Let me know if you still have any questions or problems using smartupdater.

    best regards,

    -Vadim

    ReplyDelete
    Replies
    1. Hi Vadim,

      thanks for responding

      i have a div that hold some content you got mail and that kind of stuff

      i update the content of the div using smartupdater

      on mouse over the div i stop smart updater so the contents will stay the same

      on mouse out i restart smartupdater

      the problem is that the user can hover in and out of the div at any time and at restart smartupdater imediatly sends a request to the server so on repeted mouse over mouse out i get a lot of request

      would be nice to have pause and continue so if the timeout is taken in consideration on continue

      Regards,
      Ionut

      Delete
    2. Здравствуйте, Вадим
      К сожалению, не владею английским.
      Примерно понял суть.
      Не могли бы вы рассказать более подробно о smartupdater ?
      В чем основная прелесть его использования против обычного:
      $(document).ready(function(){
      setInterval('new()',10000);
      });

      Delete
  5. Hi Ionut,

    Now I see your problem. I don't think I'll implement what you suggesting, as I don't want to add complexity to the plugin.

    So, you have to solve the problem at application level. Say, you can create a flag "pointer_in" and associate it with the element. Callback function can checks the flag and either update the DIV, or skip updating. It's easy to implement as you already have triggers associated with mouse events.

    Good luck :)

    ReplyDelete
    Replies
    1. Hi Vadim,

      Ok no problem i can understand your position.
      I will try your suggestion.
      I'm new with javascript and jquery so if is not to much troucle can you give a small example pseudo code not the actual script if it takes to much of your time

      Best regards,
      Ionut

      Delete
  6. take a look at

    http://www.eslinstructor.net/test/lonut/

    good luck :)

    ReplyDelete
  7. Following message on my github:
    https://github.com/vkiryukhin/Smartupdater/issues/8#issuecomment-5247119
    Thank you, I decided to start every 60 seconds an ajax request that refreshes DIV with an HTML content.
    But if you move your mouse over the Contener the execution must stop and restart once outside.
    Best regards

    ReplyDelete
  8. Let me clarify:

    a) you have a div element, which is populated with data.
    b) you have a container element, which is parent for this div.
    c) you update div every 60 sec.
    d) you want to stop updating if pointer is moved inside container
    e) you want to continue updating as soon as pointer left this container

    If it is correct, please see example at http://www.eslinstructor.net/test/lonut/

    hope this helps,

    -Vadim

    ReplyDelete