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) ?
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 ?
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
Здравствуйте, Вадим К сожалению, не владею английским. Примерно понял суть. Не могли бы вы рассказать более подробно о smartupdater ? В чем основная прелесть его использования против обычного: $(document).ready(function(){ setInterval('new()',10000); });
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.
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
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
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/
Hi,
ReplyDeleteHow 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) ?
Hi Anonymous,
ReplyDeleteplease 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
hi Vadim
ReplyDeletei 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
Hi Ionut,
ReplyDeleteI'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
Hi Vadim,
Deletethanks 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К сожалению, не владею английским.
Примерно понял суть.
Не могли бы вы рассказать более подробно о smartupdater ?
В чем основная прелесть его использования против обычного:
$(document).ready(function(){
setInterval('new()',10000);
});
Hi Ionut,
ReplyDeleteNow 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 :)
Hi Vadim,
DeleteOk 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
take a look at
ReplyDeletehttp://www.eslinstructor.net/test/lonut/
good luck :)
thanks a lot vadim :)
DeleteFollowing message on my github:
ReplyDeletehttps://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
Let me clarify:
ReplyDeletea) 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