[jQuery] Re: Sever Push - "live" site
Hey Morgan, any ideas on what i can do with mine? To have my page updated as live as possible, at the link I gave on the original post, I am trying to keep the word boxes you see updated, show them being added, dragged. Thats what i am trying to push. Any ideas? Thank you, Ryan On Jan 7, 6:35 pm, "Morgan Allen" <[EMAIL PROTECTED]> wrote: > Opps, meant to add more here. Hope this helps you, please ask more detail > questions if not, I am doing a lot of work right now with Comet. Server Push > methods, and Bayuex, and am currently working to bring Comet to jQuery. So > any ideas for usage will help me make my plugin useful to the jQuery masses. > > On Jan 7, 2008 3:33 PM, Morgan Allen <[EMAIL PROTECTED]> wrote: > > > > > I am not sure. It is dependent on how your PHP backend works. Looking at > > your demo I see that when I move a word, it is POSTed to store.php, is > > that then entered into a database? stored in a flat file? held in memory > > with magic? Regardless, the idea is that in words.php (say, > > words.php?waitForUpdate=true), > > would loop until either your database; flatfile; or magic storage is > > updated, then return the results and start a new waiting connection. > > > On Jan 7, 2008 2:10 PM, coughlinsmyalias < [EMAIL PROTECTED]> wrote: > > > > Thank you! After going through your code when I go to: > > > > keepLive.php?wait=e > > > > I get: > > > > 1199743545 > > > > And when i load the HTML page, I get no input and no errors, with my > > > code below: > > > > > > > > > > > > > > > >jQuery(function() > > >{ > > >$('input#hurumph').click(function() > > >{ > > >$.ajax( > > >{ > > >url: 'keepLive.php?wait=' + $('#in').val(), > > >success: function(sReturn) > > >{ > > >$('span#time').html(sReturn); > > >} > > >}); > > >}); > > >}); > > > > > > > > > > > > >What time is it in > > > seconds > > type="button" value="?" id="hurumph"/> > > > > > >?: > > > > > > > > > > Here is my new code:http://pastie.caboo.se/136398that is the code > > > that i am trying to implement it with. To see other peoples action on > > > the site, in that case what would be my PHP be? I have been at many > > > many articles on this and just need some one on one for explanation. > > > Thanks for that demo! > > > > On Jan 6, 10:01 pm, "Morgan Allen" <[EMAIL PROTECTED]> wrote: > > > > A simple way to do this in PHP is using a loop to wait for an event, > > > and > > > > return if and when it does. Otherwise the connection times out, and > > > the > > > > client (web browser using XMLHttpRequest) reconnects. A really simple > > > > demonstration can be seen by just doing an ajax request to a php > > > script that > > > > sleep()'s. Here is an example. > > > > > > > > if($_REQUEST['wait']) > > > > { > > > > sleep($_REQUEST['wait']); > > > > echo time(); > > > > die(); > > > > } > > > > ?> > > > > > > > > > > > > > > > > > > > > jQuery(function() > > > > { > > > > $('input#hurumph').click(function() > > > > { > > > > $.ajax( > > > > { > > > > url: ' index.php?wait=' + $('#in').val(), > > > > success: function(sReturn) > > > > { > > > > $('span#time').html(sReturn); > > > > } > > > > }); > > > > }); > > > > }); > > > > > > > > > > > > > > > > > What time is it in > > id="in"/> seconds > > > type="button" value="?" id="hurumph"/> > > > > > > > > ?: > > > > > > > > > > > > > Just takes a simple input and wait the given amount of time. You can > > > see > > > > from this that you could easily wait for any other sort of event. Like > > > > another user making and update. At that the point the connection get > > > closed, > > > > and the client just restarts it. > > > > > On Jan 6, 2008 3:56 PM, coughlinsmyalias <[EMAIL PROTECTED]> wrote: > > > > > > Hey all, i have been researching googling and many other ways to try > > > > > to find out how to make my site as close to "live" as I can. > > > > > > I read this by John: > > >http://ejohn.org/blog/streaming-http-server-push/ > > > > > but am still kind of confused. My site is: > > > > > >http://rksdesignstudios.com/magnet/ > > > > > > - Drag a word > > > > > - Add a word > > > > > - Delete > > > > > > And many features to come, etc. I want to make it like you can seeo > > > > > ther changes being made..stuff being dragged, any idea how to do > > > this? > > > > > I have been STUMP
[jQuery] Re: Sever Push - "live" site
Thank you Morgan for your reply, You are correct, the site: You can add a word via the form, it calls, add.php You can drag to the delete box to delete from the database, it calls, delete.php When you drag a word, on the STOP event it will send the, ID, word name, x, y coods to the database, via store.php It is all MySQL/PHP drive, no flat files. Its the looping, I think i need help with. I have read so many articles to try to understand it :p http://pastie.caboo.se/136727 Thank you for your help, Ryan Just read your post after, that is neat, how you want to bring Comet to jQuery :) Let me know of your progress. I am curious! Or if you want any input. Just throwing it out there On Jan 7, 6:33 pm, "Morgan Allen" <[EMAIL PROTECTED]> wrote: > I am not sure. It is dependent on how your PHP backend works. Looking at > your demo I see that when I move a word, it is POSTed to store.php, is that > then entered into a database? stored in a flat file? held in memory with > magic? Regardless, the idea is that in words.php (say, > words.php?waitForUpdate=true), > would loop until either your database; flatfile; or magic storage is > updated, then return the results and start a new waiting connection. > > On Jan 7, 2008 2:10 PM, coughlinsmyalias <[EMAIL PROTECTED]> wrote: > > > > > > > Thank you! After going through your code when I go to: > > > keepLive.php?wait=e > > > I get: > > > 1199743545 > > > And when i load the HTML page, I get no input and no errors, with my > > code below: > > > > > > > > > > >jQuery(function() > >{ > >$('input#hurumph').click(function() > >{ > >$.ajax( > >{ > >url: 'keepLive.php?wait=' + $('#in').val(), > >success: function(sReturn) > >{ > >$('span#time').html(sReturn); > >} > >}); > >}); > >}); > > > > > > > > >What time is it in > > seconds > type="button" value="?" id="hurumph"/> > > > >?: > > > > > > > Here is my new code:http://pastie.caboo.se/136398that is the code > > that i am trying to implement it with. To see other peoples action on > > the site, in that case what would be my PHP be? I have been at many > > many articles on this and just need some one on one for explanation. > > Thanks for that demo! > > > On Jan 6, 10:01 pm, "Morgan Allen" <[EMAIL PROTECTED]> wrote: > > > A simple way to do this in PHP is using a loop to wait for an event, and > > > return if and when it does. Otherwise the connection times out, and the > > > client (web browser using XMLHttpRequest) reconnects. A really simple > > > demonstration can be seen by just doing an ajax request to a php script > > that > > > sleep()'s. Here is an example. > > > > > > if($_REQUEST['wait']) > > > { > > > sleep($_REQUEST['wait']); > > > echo time(); > > > die(); > > > } > > > ?> > > > > > > > > > > > > > > > jQuery(function() > > > { > > > $('input#hurumph').click(function() > > > { > > > $.ajax( > > > { > > > url: 'index.php?wait=' + $('#in').val(), > > > success: function(sReturn) > > > { > > > $('span#time').html(sReturn); > > > } > > > }); > > > }); > > > }); > > > > > > > > > > > > > What time is it in > id="in"/> seconds > > type="button" value="?" id="hurumph"/> > > > > > > ?: > > > > > > > > > > Just takes a simple input and wait the given amount of time. You can see > > > from this that you could easily wait for any other sort of event. Like > > > another user making and update. At that the point the connection get > > closed, > > > and the client just restarts it. > > > > On Jan 6, 2008 3:56 PM, coughlinsmyalias <[EMAIL PROTECTED]> wrote: > > > > > Hey all, i have been researching googling and many other ways to try > > > > to find out how to make my site as close to "live" as I can. > > > > > I read this by John:http://ejohn.org/blog/streaming-http-server-push/ > > > > but am still kind of confused. My site is: > > > > >http://rksdesignstudios.com/magnet/ > > > > > - Drag a word > > > > - Add a word > > > > - Delete > > > > > And many features to come, etc. I want to make it like you can seeo > > > > ther changes being made..stuff being dragged, any idea how to do this? > > > > I have been STUMPED on this. > > > > > Thanks! > > > > Ryan > > > > --http://morglog.alleycatracing.com > > > Lets make up more accronyms! > > > >http://www.alleycatracing.com > > > LTABOTIIOFR! ROFL! ROFL! ROFL! > > > Upcomin
[jQuery] Re: Sever Push - "live" site
Ahh..I see how it works..well a better idea anyway. How that talks with the PHP. At my site that I posted above..how would something like that work? set up an event? Because I want each drag sequence to show on the page and keep it updated along with adding words, etc. Thank you - http://pastie.caboo.se/136398 Seeing that example was a help thank you! Ryan IGNORE THAT LAST MESSAGE, I got it :) On Jan 6, 10:01 pm, "Morgan Allen" <[EMAIL PROTECTED]> wrote: > A simple way to do this in PHP is using a loop to wait for an event, and > return if and when it does. Otherwise the connection times out, and the > client (web browser using XMLHttpRequest) reconnects. A really simple > demonstration can be seen by just doing an ajax request to a php script that > sleep()'s. Here is an example. > > if($_REQUEST['wait']) > { > sleep($_REQUEST['wait']); > echo time(); > die(); > } > ?> > > > > > jQuery(function() > { > $('input#hurumph').click(function() > { > $.ajax( > { > url: 'index.php?wait=' + $('#in').val(), > success: function(sReturn) > { > $('span#time').html(sReturn); > } > }); > }); > }); > > > > > What time is it in seconds type="button" value="?" id="hurumph"/> > > ?: > > > > Just takes a simple input and wait the given amount of time. You can see > from this that you could easily wait for any other sort of event. Like > another user making and update. At that the point the connection get closed, > and the client just restarts it. > > On Jan 6, 2008 3:56 PM, coughlinsmyalias <[EMAIL PROTECTED]> wrote: > > > > > > > Hey all, i have been researching googling and many other ways to try > > to find out how to make my site as close to "live" as I can. > > > I read this by John:http://ejohn.org/blog/streaming-http-server-push/ > > but am still kind of confused. My site is: > > >http://rksdesignstudios.com/magnet/ > > > - Drag a word > > - Add a word > > - Delete > > > And many features to come, etc. I want to make it like you can seeo > > ther changes being made..stuff being dragged, any idea how to do this? > > I have been STUMPED on this. > > > Thanks! > > Ryan > > --http://morglog.alleycatracing.com > Lets make up more accronyms! > > http://www.alleycatracing.com > LTABOTIIOFR! ROFL! ROFL! ROFL! > Upcoming alley cats, reviews, touring logs, and a general congregation of > bike nerdity.
[jQuery] Re: Sever Push - "live" site
Opps, meant to add more here. Hope this helps you, please ask more detail questions if not, I am doing a lot of work right now with Comet. Server Push methods, and Bayuex, and am currently working to bring Comet to jQuery. So any ideas for usage will help me make my plugin useful to the jQuery masses. On Jan 7, 2008 3:33 PM, Morgan Allen <[EMAIL PROTECTED]> wrote: > I am not sure. It is dependent on how your PHP backend works. Looking at > your demo I see that when I move a word, it is POSTed to store.php, is > that then entered into a database? stored in a flat file? held in memory > with magic? Regardless, the idea is that in words.php (say, > words.php?waitForUpdate=true), > would loop until either your database; flatfile; or magic storage is > updated, then return the results and start a new waiting connection. > > > On Jan 7, 2008 2:10 PM, coughlinsmyalias < [EMAIL PROTECTED]> wrote: > > > > > Thank you! After going through your code when I go to: > > > > keepLive.php?wait=e > > > > I get: > > > > 1199743545 > > > > And when i load the HTML page, I get no input and no errors, with my > > code below: > > > > > > > > > > > > > >jQuery(function() > >{ > >$('input#hurumph').click(function() > >{ > >$.ajax( > >{ > >url: 'keepLive.php?wait=' + $('#in').val(), > >success: function(sReturn) > >{ > >$('span#time').html(sReturn); > >} > >}); > >}); > >}); > > > > > > > > > >What time is it in > > seconds > type="button" value="?" id="hurumph"/> > > > >?: > > > > > > > > Here is my new code: http://pastie.caboo.se/136398 that is the code > > that i am trying to implement it with. To see other peoples action on > > the site, in that case what would be my PHP be? I have been at many > > many articles on this and just need some one on one for explanation. > > Thanks for that demo! > > > > On Jan 6, 10:01 pm, "Morgan Allen" <[EMAIL PROTECTED]> wrote: > > > A simple way to do this in PHP is using a loop to wait for an event, > > and > > > return if and when it does. Otherwise the connection times out, and > > the > > > client (web browser using XMLHttpRequest) reconnects. A really simple > > > demonstration can be seen by just doing an ajax request to a php > > script that > > > sleep()'s. Here is an example. > > > > > > > > if($_REQUEST['wait']) > > > { > > > sleep($_REQUEST['wait']); > > > echo time(); > > > die(); > > > } > > > ?> > > > > > > > > > > > > > > > jQuery(function() > > > { > > > $('input#hurumph').click(function() > > > { > > > $.ajax( > > > { > > > url: ' index.php?wait=' + $('#in').val(), > > > success: function(sReturn) > > > { > > > $('span#time').html(sReturn); > > > } > > > }); > > > }); > > > }); > > > > > > > > > > > > > > > What time is it in > id="in"/> seconds > > type="button" value="?" id="hurumph"/> > > > > > > ?: > > > > > > > > > > > > Just takes a simple input and wait the given amount of time. You can > > see > > > from this that you could easily wait for any other sort of event. Like > > > another user making and update. At that the point the connection get > > closed, > > > and the client just restarts it. > > > > > > On Jan 6, 2008 3:56 PM, coughlinsmyalias <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > > > > > > > Hey all, i have been researching googling and many other ways to try > > > > to find out how to make my site as close to "live" as I can. > > > > > > > I read this by John: > > http://ejohn.org/blog/streaming-http-server-push/ > > > > but am still kind of confused. My site is: > > > > > > > http://rksdesignstudios.com/magnet/ > > > > > > > - Drag a word > > > > - Add a word > > > > - Delete > > > > > > > And many features to come, etc. I want to make it like you can seeo > > > > ther changes being made..stuff being dragged, any idea how to do > > this? > > > > I have been STUMPED on this. > > > > > > > Thanks! > > > > Ryan > > > > > > --http://morglog.alleycatracing.com > > > Lets make up more accronyms! > > > > > > http://www.alleycatracing.com > > > LTABOTIIOFR! ROFL! ROFL! ROFL! > > > Upcoming alley cats, reviews, touring logs, and a general congregation > > of > > > bike nerdity. > > > > > > -- > > http://morglog.alleycatracing.com > Lets make up more accronyms! > > http://www.alleycatracing.com > LTABOTIIOFR! ROFL! ROFL! ROFL! > Upcoming alley cats, reviews
[jQuery] Re: Sever Push - "live" site
I am not sure. It is dependent on how your PHP backend works. Looking at your demo I see that when I move a word, it is POSTed to store.php, is that then entered into a database? stored in a flat file? held in memory with magic? Regardless, the idea is that in words.php (say, words.php?waitForUpdate=true), would loop until either your database; flatfile; or magic storage is updated, then return the results and start a new waiting connection. On Jan 7, 2008 2:10 PM, coughlinsmyalias <[EMAIL PROTECTED]> wrote: > > Thank you! After going through your code when I go to: > > keepLive.php?wait=e > > I get: > > 1199743545 > > And when i load the HTML page, I get no input and no errors, with my > code below: > > > > > > >jQuery(function() >{ >$('input#hurumph').click(function() >{ >$.ajax( >{ >url: 'keepLive.php?wait=' + $('#in').val(), >success: function(sReturn) >{ >$('span#time').html(sReturn); >} >}); >}); >}); > > > > >What time is it in > seconds type="button" value="?" id="hurumph"/> > >?: > > > > Here is my new code: http://pastie.caboo.se/136398 that is the code > that i am trying to implement it with. To see other peoples action on > the site, in that case what would be my PHP be? I have been at many > many articles on this and just need some one on one for explanation. > Thanks for that demo! > > On Jan 6, 10:01 pm, "Morgan Allen" <[EMAIL PROTECTED]> wrote: > > A simple way to do this in PHP is using a loop to wait for an event, and > > return if and when it does. Otherwise the connection times out, and the > > client (web browser using XMLHttpRequest) reconnects. A really simple > > demonstration can be seen by just doing an ajax request to a php script > that > > sleep()'s. Here is an example. > > > > > if($_REQUEST['wait']) > > { > > sleep($_REQUEST['wait']); > > echo time(); > > die(); > > } > > ?> > > > > > > > > > > jQuery(function() > > { > > $('input#hurumph').click(function() > > { > > $.ajax( > > { > > url: 'index.php?wait=' + $('#in').val(), > > success: function(sReturn) > > { > > $('span#time').html(sReturn); > > } > > }); > > }); > > }); > > > > > > > > > > What time is it in id="in"/> seconds > type="button" value="?" id="hurumph"/> > > > > ?: > > > > > > > > Just takes a simple input and wait the given amount of time. You can see > > from this that you could easily wait for any other sort of event. Like > > another user making and update. At that the point the connection get > closed, > > and the client just restarts it. > > > > On Jan 6, 2008 3:56 PM, coughlinsmyalias <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > > > Hey all, i have been researching googling and many other ways to try > > > to find out how to make my site as close to "live" as I can. > > > > > I read this by John:http://ejohn.org/blog/streaming-http-server-push/ > > > but am still kind of confused. My site is: > > > > >http://rksdesignstudios.com/magnet/ > > > > > - Drag a word > > > - Add a word > > > - Delete > > > > > And many features to come, etc. I want to make it like you can seeo > > > ther changes being made..stuff being dragged, any idea how to do this? > > > I have been STUMPED on this. > > > > > Thanks! > > > Ryan > > > > --http://morglog.alleycatracing.com > > Lets make up more accronyms! > > > > http://www.alleycatracing.com > > LTABOTIIOFR! ROFL! ROFL! ROFL! > > Upcoming alley cats, reviews, touring logs, and a general congregation > of > > bike nerdity. > -- http://morglog.alleycatracing.com Lets make up more accronyms! http://www.alleycatracing.com LTABOTIIOFR! ROFL! ROFL! ROFL! Upcoming alley cats, reviews, touring logs, and a general congregation of bike nerdity.
[jQuery] Re: Sever Push - "live" site
Thank you! After going through your code when I go to: keepLive.php?wait=e I get: 1199743545 And when i load the HTML page, I get no input and no errors, with my code below: jQuery(function() { $('input#hurumph').click(function() { $.ajax( { url: 'keepLive.php?wait=' + $('#in').val(), success: function(sReturn) { $('span#time').html(sReturn); } }); }); }); What time is it in seconds ?: Here is my new code: http://pastie.caboo.se/136398 that is the code that i am trying to implement it with. To see other peoples action on the site, in that case what would be my PHP be? I have been at many many articles on this and just need some one on one for explanation. Thanks for that demo! On Jan 6, 10:01 pm, "Morgan Allen" <[EMAIL PROTECTED]> wrote: > A simple way to do this in PHP is using a loop to wait for an event, and > return if and when it does. Otherwise the connection times out, and the > client (web browser using XMLHttpRequest) reconnects. A really simple > demonstration can be seen by just doing an ajax request to a php script that > sleep()'s. Here is an example. > > if($_REQUEST['wait']) > { > sleep($_REQUEST['wait']); > echo time(); > die(); > } > ?> > > > > > jQuery(function() > { > $('input#hurumph').click(function() > { > $.ajax( > { > url: 'index.php?wait=' + $('#in').val(), > success: function(sReturn) > { > $('span#time').html(sReturn); > } > }); > }); > }); > > > > > What time is it in seconds type="button" value="?" id="hurumph"/> > > ?: > > > > Just takes a simple input and wait the given amount of time. You can see > from this that you could easily wait for any other sort of event. Like > another user making and update. At that the point the connection get closed, > and the client just restarts it. > > On Jan 6, 2008 3:56 PM, coughlinsmyalias <[EMAIL PROTECTED]> wrote: > > > > > > > Hey all, i have been researching googling and many other ways to try > > to find out how to make my site as close to "live" as I can. > > > I read this by John:http://ejohn.org/blog/streaming-http-server-push/ > > but am still kind of confused. My site is: > > >http://rksdesignstudios.com/magnet/ > > > - Drag a word > > - Add a word > > - Delete > > > And many features to come, etc. I want to make it like you can seeo > > ther changes being made..stuff being dragged, any idea how to do this? > > I have been STUMPED on this. > > > Thanks! > > Ryan > > --http://morglog.alleycatracing.com > Lets make up more accronyms! > > http://www.alleycatracing.com > LTABOTIIOFR! ROFL! ROFL! ROFL! > Upcoming alley cats, reviews, touring logs, and a general congregation of > bike nerdity.
[jQuery] Re: Sever Push - "live" site
A simple way to do this in PHP is using a loop to wait for an event, and return if and when it does. Otherwise the connection times out, and the client (web browser using XMLHttpRequest) reconnects. A really simple demonstration can be seen by just doing an ajax request to a php script that sleep()'s. Here is an example. jQuery(function() { $('input#hurumph').click(function() { $.ajax( { url: 'index.php?wait=' + $('#in').val(), success: function(sReturn) { $('span#time').html(sReturn); } }); }); }); What time is it in seconds ?: Just takes a simple input and wait the given amount of time. You can see from this that you could easily wait for any other sort of event. Like another user making and update. At that the point the connection get closed, and the client just restarts it. On Jan 6, 2008 3:56 PM, coughlinsmyalias <[EMAIL PROTECTED]> wrote: > > Hey all, i have been researching googling and many other ways to try > to find out how to make my site as close to "live" as I can. > > I read this by John: http://ejohn.org/blog/streaming-http-server-push/ > but am still kind of confused. My site is: > > http://rksdesignstudios.com/magnet/ > > - Drag a word > - Add a word > - Delete > > And many features to come, etc. I want to make it like you can seeo > ther changes being made..stuff being dragged, any idea how to do this? > I have been STUMPED on this. > > Thanks! > Ryan > -- http://morglog.alleycatracing.com Lets make up more accronyms! http://www.alleycatracing.com LTABOTIIOFR! ROFL! ROFL! ROFL! Upcoming alley cats, reviews, touring logs, and a general congregation of bike nerdity.