[jQuery] Combining Selectables and Draggables

2008-11-27 Thread coughlinsmyalias

I wrote up an article doing my best to explain how to use both
selecable and draggable UI elements to work together to select a group
and to drag them. I Richard. Worth helped me about a year ago to try
to figure it out, but it was kind of buggy, then I asked him if he
found a solution, so I decided to write an article about it and share
it since I know I am not that only one who wants to know how to do
this.

Link: 
http://www.ryancoughlin.com/2008/11/23/combining-selectables-and-draggables-using-jquery-ui/

Thank you,

Ryan


[jQuery] Re: .click vs. .bind

2008-11-24 Thread coughlinsmyalias

Thank you guys for your help!

On Nov 23, 8:01 pm, George <[EMAIL PROTECTED]> wrote:
> Just a note: The bind notation allows you to specify additional data
> for your even handler function.
> I am actually used to always use a .bind
>
> George.
>
> On Nov 23, 7:47 pm, "Michael Geary" <[EMAIL PROTECTED]> wrote:
>
> > There is no difference at all.
>
> > $(...).click( fn )
>
> > is merely a shorthand for:
>
> > $(...).bind( 'click', fn );
>
> > You can see this in the code that creates .click() and the other shortcut
> > methods:
>
> > jQuery.each( ("blur,focus,load,resize,scroll,unload,click,dblclick," +
> >     "mousedown,mouseup,mousemove,mouseover,mouseout,change,select," +
> >     "submit,keydown,keypress,keyup,error").split(","), function(i, name){
>
> >     // Handle event binding
> >     jQuery.fn[name] = function(fn){
> >         return fn ? this.bind(name, fn) : this.trigger(name);
> >     };
>
> > });
>
> > -Mike
>
> > > From: coughlinsmyalias
>
> > > What is the main difference between using .bind() and
> > > .click(), when I was reading up, it was mentioning it removes
> > > event bubbling?- Hide quoted text -
>
> > - Show quoted text -


[jQuery] .click vs. .bind

2008-11-23 Thread coughlinsmyalias

Hey All,

What is the main difference between using .bind() and .click(), when I
was reading up, it was mentioning it removes event bubbling?

Thanks,

Ryan


[jQuery] Re: how do you get a div from an ajax form return?

2008-11-22 Thread coughlinsmyalias

Hey,

Can you send me your code to look at. Are you trying to update a DIV
or use it as a succss show?

On Nov 22, 6:08 pm, davidgregan <[EMAIL PROTECTED]> wrote:
> I'm using the jquery forms plugin for an ajax request and update. I
> set the target option to the desired div that I want to update. The
> problem that I'm running into is that it will update the div with the
> contents of the entire page rather than the just the contents of that
> div. I'd like to do this without creating another view for just the
> div alone. What is the proper way to do this? Return the calls results
> to a variable and then parse the variable for the desired div? Is
> there another way? Thanks in advanced.


[jQuery] Same effect for multiple classes

2008-11-22 Thread coughlinsmyalias

Hey,

I am trying to create something similar to an Accordion effect using
jQuery but some some modifications. I have a  with a bunch of
elements inside (). When you click say a link within the 
slide a  down to reveal a quick description about the post. The
part I am stuck at is, how do I use the selector for each.

I do not want to make a section of code to animate for each one, is
there a way to use each() to create each segment for each header, you
can check it at the right section of my page under the header "ALL THE
GOODS"

Any thoughts? I have been trying to get this for awhile with no luck.

Thanks,

Ryan


[jQuery] Re: Simple Validate if empty

2008-11-22 Thread coughlinsmyalias

Hey Daniel,

Thank you for that, just what I needed.

Ryan

On Nov 22, 4:26 am, Daniel <[EMAIL PROTECTED]> wrote:
> if($('#term').val() == ""){
>   alert("empty");
>   //do something}else{
>
>   alert($('#term').val());
>   //do something
>
> }
>
> On Nov 22, 3:32 am, coughlinsmyalias <[EMAIL PROTECTED]> wrote:
>
> > Hey,
>
> > I have been trying to look for a simple way to validate one field, if
> > its empty then do X, how would I check? I have this:
>
> > term = $('#term').attr('value');
>
> > Would I check if term is empty? Then don't allow the submit, my code
> > is here:http://pastie.org/320870
>
> > Any thoughts?
>
> > Thanks,
>
> > Ryan


[jQuery] Simple Validate if empty

2008-11-21 Thread coughlinsmyalias

Hey,

I have been trying to look for a simple way to validate one field, if
its empty then do X, how would I check? I have this:

term = $('#term').attr('value');

Would I check if term is empty? Then don't allow the submit, my code
is here: http://pastie.org/320870

Any thoughts?

Thanks,

Ryan


[jQuery] Re: Lightbox overlay, fade out background

2008-11-13 Thread coughlinsmyalias

Thank you, ill check that out.

Ryan

On Nov 13, 8:38 pm, "Josh Nathanson" <[EMAIL PROTECTED]> wrote:
> No need to reinvent the wheel, I'd use the BlockUI plugin in conjunction
> with whatever you're working on.
>
> -- Josh
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
>
> Behalf Of coughlinsmyalias
> Sent: Thursday, November 13, 2008 5:15 PM
> To: jQuery (English)
> Subject: [jQuery] Lightbox overlay, fade out background
>
> Hey guys, I have been looking at some code of lighboxes and am trying
> to fade out the background like you see when you look at lightbox
> scripts. I am trying to get some code from other plugins but it is
> kind of a mess.
>
> Do anyone of you know how to fade out the background add an overlay
> with an opacity, to cover the entire page?
>
> Thanks,
>
> Ryan


[jQuery] Lightbox overlay, fade out background

2008-11-13 Thread coughlinsmyalias

Hey guys, I have been looking at some code of lighboxes and am trying
to fade out the background like you see when you look at lightbox
scripts. I am trying to get some code from other plugins but it is
kind of a mess.

Do anyone of you know how to fade out the background add an overlay
with an opacity, to cover the entire page?

Thanks,

Ryan


[jQuery] Re: $(window).bind("load",function(){ vs onready

2008-04-08 Thread coughlinsmyalias

I have heard about loading them at the end of the page, I would love
to see statistics on it as well. I understand this all now, I kept
seeing both and I was confused each of them.

I didnt know that it now waits for .css.

Thank you both Nick and Rob

On Apr 7, 11:21 pm, RobG <[EMAIL PROTECTED]> wrote:
> On Apr 8, 7:24 am, coughlinsmyalias <[EMAIL PROTECTED]> wrote:
>
> > Thank you! What do you think is better to use? And when would you use
> > one compared to another?
>
> There is also the strategy of loading all your script files just
> before the closing body tag, at that point you can run whatever script
> you want.  It has the added benefits of being compatible in a wider
> range of browsers that document.ready and your page will appear to
> load faster than loading scripts in the head.
>
> --
> Rob


[jQuery] Re: $(window).bind("load",function(){ vs onready

2008-04-07 Thread coughlinsmyalias

Thank you! What do you think is better to use? And when would you use
one compared to another?

Thanks!

Ryan

ps, ill check out the docs you supplied

On Apr 7, 4:55 pm, MorningZ <[EMAIL PROTECTED]> wrote:
> Your browser window's "Load" event doesn't fire until the document is
> fully loaded (images and all)
>
> The "Ready" event fires when the DOM is ready
>
> More verbose description of "Ready" is in the docs
>
> http://docs.jquery.com/Events/ready


[jQuery] Re: :first make faster?

2008-04-07 Thread coughlinsmyalias

So is it faster, im confused, haha.

On Apr 7, 12:28 pm, ripple <[EMAIL PROTECTED]> wrote:
> It appears that by running a test in the core, there's a for loop that 
> acquires all of the related elements and returns the first on a return i == 0;
>
>   jquery.extend({ extend: {
>
>   first: function(a,i){;return i==0;},
>
>   a is selector, i is loop
>
> deer421 <[EMAIL PROTECTED]> wrote:
>
> Does :first make the selection faster? In other words, does it stop
> the selection after the first item is found or it filters only after
> all selections are found?
>
> -
> You rock. That's why Blockbuster's offering you one month of Blockbuster 
> Total Access, No Cost.


[jQuery] Re: setinterval vs. settimeout

2008-04-07 Thread coughlinsmyalias

Hey Ariel, I like this article, its laid out perfectly!

On Apr 7, 1:03 pm, Ariel Flesler <[EMAIL PROTECTED]> wrote:
> http://ejohn.org/blog/how-javascript-timers-work/
>
> --
> Ariel Fleslerhttp://flesler.blogspot.com
>
> On 7 abr, 12:53, coughlinsmyalias <[EMAIL PROTECTED]> wrote:
>
> > Hey, I found this article 
> > here:http://www.evolt.org/article/Using_setInterval_to_Make_a_JavaScript_L...
> > - to try to clear up my confusion with setInterval and setTimeout, but
> > still kind of confused, but this is what I got out of it so far:
>
> > setInterval: Does X every X ms
>
> > setTimeout: Delays X every X ms
>
> > Is that close or am I completely off? If someone has a more clear
> > example could you post it :)
>
> > Also, if I want to try to keep my site as "live" and "updated" as
> > possible, which would be better.
>
> > Thanks,
>
> > Ryan


[jQuery] Re: setinterval vs. settimeout

2008-04-07 Thread coughlinsmyalias

Thank you for this! This is exactly what I needed. Thanks Jake.

Ryan

On Apr 7, 12:51 pm, "Jake McGraw" <[EMAIL PROTECTED]> wrote:
> The following will pop up an alert dialog EVERY 20 (2 milliseconds) 
> seconds:
>
> window.setInterval(function(){alert('Hello!');},2);
>
> The following will pop up an alert dialog ONCE, AFTER 20 (2 ms) seconds:
>
> window.setTimeout(function(){alert('Hello!');},2);
>
> To keep your site "updated" you would use setInterval, as it will be
> called continuously.
>
> - jake
>
> On Mon, Apr 7, 2008 at 11:53 AM, coughlinsmyalias <[EMAIL PROTECTED]> wrote:
>
> >  Hey, I found this article here:
> >  http://www.evolt.org/article/Using_setInterval_to_Make_a_JavaScript_L...
> >  - to try to clear up my confusion with setInterval and setTimeout, but
> >  still kind of confused, but this is what I got out of it so far:
>
> >  setInterval: Does X every X ms
>
> >  setTimeout: Delays X every X ms
>
> >  Is that close or am I completely off? If someone has a more clear
> >  example could you post it :)
>
> >  Also, if I want to try to keep my site as "live" and "updated" as
> >  possible, which would be better.
>
> >  Thanks,
>
> >  Ryan


[jQuery] Re: :first make faster?

2008-04-07 Thread coughlinsmyalias

That is a very good question, I tried doing a quick search on it and
nothing. When you think about it, you think it would make it faster
because you are saying use :first, so it would stop there, therefore
making the selection faster, because you are telling it which element
to use.

Sounds like it makes sense, maybe someone else has a more factual
answer.

Ryan

On Apr 7, 10:07 am, deer421 <[EMAIL PROTECTED]> wrote:
> Does :first make the selection faster? In other words, does it stop
> the selection after the first item is found or it filters only after
> all selections are found?


[jQuery] $(window).bind("load",function(){ vs onready

2008-04-07 Thread coughlinsmyalias

Hey,

I have a really quick question, what is the difference between doing:

$(window).bind("load",function(){

And

$(document).ready(function(){


Just was on my mind and was curious.

Thanks,

Ryan


[jQuery] setinterval vs. settimeout

2008-04-07 Thread coughlinsmyalias

Hey, I found this article here:
http://www.evolt.org/article/Using_setInterval_to_Make_a_JavaScript_Listener/17/36035/
- to try to clear up my confusion with setInterval and setTimeout, but
still kind of confused, but this is what I got out of it so far:


setInterval: Does X every X ms

setTimeout: Delays X every X ms

Is that close or am I completely off? If someone has a more clear
example could you post it :)

Also, if I want to try to keep my site as "live" and "updated" as
possible, which would be better.

Thanks,

Ryan


[jQuery] Re: Comet Technique - possible with jQuery? Plugin?

2008-04-07 Thread coughlinsmyalias

Thank you! With the Bayeux implementation, what will that allow me to
do? I am already using ajax calls in my page to get my words and to
keep the x/y for each element, you can see by going to the site.

Then a comet server? What is the real advantage there?

Thanks

On Apr 6, 4:19 pm, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> coughlinsmyalias schrieb:> Hey,
>
> > I have been doing some research on Comet to use on my site:
> >http://rksdesignstudios.com/magnet/- To try to keep it "live" as
> > possible almost to push the content to see other changes and keep the
> > page constantly updated.
>
> > I did a search here on the group but really didn't find anything, any
> > ideas on what I can do? Is there a plugin or other technologies I can
> > do using jQuery to achieve my goal?
>
> Implementing long-polling Comet with jQuery doesn't need a plugin. Just
> use jQuery's ajax methods.
>
> If you are looking for a Bayeux 
> implementation:http://plugins.jquery.com/project/Comet
>
> In any case implementing the serverside is the more difficult part,
> though there are plenty options for Comet servers. A great resource for
> that ishttp://cometdaily.com/
>
> Jörn


[jQuery] Re: Comet Technique - possible with jQuery? Plugin?

2008-04-06 Thread coughlinsmyalias

*bump*

On Apr 5, 2:57 pm, coughlinsmyalias <[EMAIL PROTECTED]> wrote:
> Hey,
>
> I have been doing some research on Comet to use on my 
> site:http://rksdesignstudios.com/magnet/- To try to keep it "live" as
> possible almost to push the content to see other changes and keep the
> page constantly updated.
>
> I did a search here on the group but really didn't find anything, any
> ideas on what I can do? Is there a plugin or other technologies I can
> do using jQuery to achieve my goal?
>
> Thanks,
>
> Ryan


[jQuery] Comet Technique - possible with jQuery? Plugin?

2008-04-05 Thread coughlinsmyalias

Hey,

I have been doing some research on Comet to use on my site:
http://rksdesignstudios.com/magnet/ - To try to keep it "live" as
possible almost to push the content to see other changes and keep the
page constantly updated.

I did a search here on the group but really didn't find anything, any
ideas on what I can do? Is there a plugin or other technologies I can
do using jQuery to achieve my goal?

Thanks,

Ryan


[jQuery] Re: Books

2008-02-25 Thread coughlinsmyalias

Thank you very much! I will go check those two books out!

Ryan

On Feb 24, 10:18 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote:
> I would strongly recommend these two:
>
> Pro JavaScript Techniques
> John 
> Resighttp://www.amazon.com/Pro-JavaScript-Techniques-John-Resig/dp/1590597273
>
> Learning jQuery: Better Interaction Design and Web Development with Simple
> JavaScript Techniques
> Karl Swedberg, Jonathan 
> Chafferhttp://www.amazon.com/Learning-jQuery-Interaction-Development-JavaScr...
>
> This one just came out. I haven't had a chance to read it yet:
>
> jQuery in Action
> Bear Bibeault, Yehuda 
> Katzhttp://www.amazon.com/jQuery-Action-Bear-Bibeault/dp/1933988355
>
> - Richard
>
> On Sun, Feb 24, 2008 at 12:07 PM, coughlinsmyalias <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > Hey, I was wondering what books you guys would reccomend? I have been
> > looking here on the groups and on Amazon and not sure which one to go
> > with?
>
> > Any ideas?
>
> > Thanks!
>
> > Ryan


[jQuery] Books

2008-02-24 Thread coughlinsmyalias

Hey, I was wondering what books you guys would reccomend? I have been
looking here on the groups and on Amazon and not sure which one to go
with?

Any ideas?

Thanks!

Ryan


[jQuery] Re: Sever Push - "live" site

2008-01-12 Thread coughlinsmyalias

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  >

[jQuery] Re: Sever Push - "live" site

2008-01-08 Thread coughlinsmyalias

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.

[jQuery] Re: Sever Push - "live" site

2008-01-07 Thread coughlinsmyalias

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: LIVE jQuery

2008-01-07 Thread coughlinsmyalias

Peter..when you say:

> fwiw, I have been considering porting the dojox.cometd client to
> jQuery-plugin-like code.

Do you mean its not a jQuery plugin yet?

Looking more in to that and am still kind of confused how to make the
whole say be "live" would every event have to be wrapped in say a
function to do so?

Thank you so much,
RYan

On Jan 6, 7:30 pm, Peter E Higgins <[EMAIL PROTECTED]> wrote:
> For whatever reason the "magnet" post didn't get pushed to my client, but I
> wanted to chime in.
>
> fwiw, I have been considering porting the dojox.cometd client to
> jQuery-plugin-like code.
>
> but as far as I know, the only "real" javascript implementation of comet
> client is the dojo 1.x one.  DWR has a java client as well, which is cool at
> a glance, but I've not had any chance to play with it.
>
> i use twistd comet server and dojox.cometd a lot. It love it. and the API is
> very simple, the jQuery would look something like:
>
> $.cometd.init(url);
> $.cometd.publish("/some/topic",{ some:"object" });
> $.cometd.subscribe("/some/topic",function(obj){
>console.log(obj.data); // [object some:object]
>
> });
>
> no ETA, I'm really just playing around with it. Big fan of comet though
> personally, would love to see it adopted in the various toolkits.
>
> Regards,
> Peter Higgins
>
> On Tuesday 01 January 2008, Eridius wrote:
>
> > This might or might not be what your looking for but if you want to keep
> > pushing new content to a page you could use the JHeartbeat plugin
>
> >http://www.jasons-toolbox.com/JHeartbeat/
>
> > coughlinsmyalias wrote:
> > > Hey all, I am wondering is it possible with jQuery or any other plugin
> > > to have say real time results on a page. To do say see what other
> > > changes are being made as you are on the screen?
>
> > > Or any with a tad bit delay of a couple of seconds?
>
> > > Thanks!
> > > Ryan


[jQuery] Re: Sever Push - "live" site

2008-01-07 Thread coughlinsmyalias

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: LIVE jQuery

2008-01-07 Thread coughlinsmyalias

Thank you for the explanation! i will do some more research in to that
and see how i can get that in to my code :) I might post a question
about implementing that in to mine as well. Any demos out there for me
to look at? And is this installed on the client side?

On Jan 7, 8:07 am, Peter E Higgins <[EMAIL PROTECTED]> wrote:
> On Monday 07 January 2008, Ariel Flesler wrote:
>
> > How is that the client can listen for responses of the server? it's an
> > XHR connection that remains opened ?
>
> there are a couple transports availble in the dojox.cometd client, long
> polling being the default. subscribe() would issue a command to the server
> (ch: /cometd/meta) to alert the server it wants messages published on some
> topic.  when something comes to the server
> via someone's publish(), anyone subscribed to that topic() gets that data.
>
> for instance, I did a magnet "demo", is was basically:
>
> connect(onDragStart) -> publish("/magnet/moving",{ node: magnetId });
> connect(onDragEnd) -> publish("/magnet/done",{
> coords:$("magnet").dimensions(),
>magnet: magnetId});
>
> subscribe("/magnet/done",function(o){
> var x = o.data.x +"px";
> var y = o.data.x +"px";
> $(o.data.magnet).css({ top: y, left: x });
>
> });
>
> > Ariel Flesler
>
> > On 6 ene, 21:30, Peter E Higgins <[EMAIL PROTECTED]> wrote:
> > > For whatever reason the "magnet" post didn't get pushed to my client, but
> > > I wanted to chime in.
>
> > > fwiw, I have been considering porting the dojox.cometd client to
> > > jQuery-plugin-like code.
>
> > > but as far as I know, the only "real" javascript implementation of comet
> > > client is the dojo 1.x one.  DWR has a java client as well, which is cool
> > > at a glance, but I've not had any chance to play with it.
>
> > > i use twistd comet server and dojox.cometd a lot. It love it. and the API
> > > is very simple, the jQuery would look something like:
>
> > > $.cometd.init(url);
> > > $.cometd.publish("/some/topic",{ some:"object" });
> > > $.cometd.subscribe("/some/topic",function(obj){
> > >console.log(obj.data); // [object some:object]
>
> > > });
>
> > > no ETA, I'm really just playing around with it. Big fan of comet though
> > > personally, would love to see it adopted in the various toolkits.
>
> > > Regards,
> > > Peter Higgins
>
> > > On Tuesday 01 January 2008, Eridius wrote:
> > > > This might or might not be what your looking for but if you want to
> > > > keep pushing new content to a page you could use the JHeartbeat plugin
>
> > > >http://www.jasons-toolbox.com/JHeartbeat/
>
> > > > coughlinsmyalias wrote:
> > > > > Hey all, I am wondering is it possible with jQuery or any other
> > > > > plugin to have say real time results on a page. To do say see what
> > > > > other changes are being made as you are on the screen?
>
> > > > > Or any with a tad bit delay of a couple of seconds?
>
> > > > > Thanks!
> > > > > Ryan- Ocultar texto de la cita -
>
> > > - Mostrar texto de la cita -


[jQuery] Sever Push - "live" site

2008-01-06 Thread coughlinsmyalias

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


[jQuery] Re: LIVE jQuery

2008-01-06 Thread coughlinsmyalias

Thank you all so much! Let me go try to understand this..I might post
back with some questions :)

I have heard of the COMET, I will read that article do you know of any
examples of code or logic using jquery and how I would use that?

http://www.jasons-toolbox.com/JHeartbeat/

For that above, could that work here:

http://rksdesignstudios.com/magnet/

I want to have it "live" to keep it updated, etc. Thanks so much

So after refreshing, I have the x/y being stored in the database then
loaded via PHP and jQuery. Anyone up for talking me through some
stuff, just for I can have something to quickly talk about with
someone to clear some stuff up.

I appreciate your help!

Ryan


[jQuery] LIVE jQuery

2007-12-29 Thread coughlinsmyalias

Hey all, I am wondering is it possible with jQuery or any other plugin
to have say real time results on a page. To do say see what other
changes are being made as you are on the screen?

Or any with a tad bit delay of a couple of seconds?

Thanks!
Ryan


[jQuery] After submit - fade in

2007-12-27 Thread coughlinsmyalias

Hey you guys!

I have this code:

$(document).ready(function(){
$('#addWord').submit(function(){
$.ajax({
type: "POST",
url: "add.php",
data: {"word": $('#word').val()}
})
$('#wordBank').load('words.php', '', function(){ $('.word',
this).draggable() });
return false;
})

$('#wordBank').load('words.php', '', function(){ $('.word',
this).draggable() })
});

And on submit..i want the new word i added via my form to be shown and
fade in. Would i use ajax.success? I have been trying to play with
this on my own for awhile know using the docs/google/groups, but no
luck at all

I have my HTML being printed via my php page, is that fine or should I
have it be loaded via jquery?

Thank you so much in advance

Ryan


[jQuery] Callback function - display on page

2007-12-27 Thread coughlinsmyalias

Hey all! I have been trying to say add a call back function after the
form has been submitted, display on the page word has been added, have
it appear for a second or so and then fade away..Any ideas on that? My
code:


$(document).ready(function(){
$('#addWord').submit(function(){
$.ajax({
type: "POST",
url: "add.php",
data: {"word": $('#word').val()}
})
$('#wordBank').load('words.php', '', function(){ $('.word',
this).draggable() });
return false;
})

$('#wordBank').load('words.php', '', function(){ $('.word',
this).draggable() })
});


Would I use ajax.success? I have been trying to check out some
different ideas, but am stuck on this. I am stumped. Thanks so much.


[jQuery] Using ajax

2007-12-26 Thread coughlinsmyalias

Hey all, I am new at jQuery and playing with it for a couple of days
and i have:

$(document).ready(function(){





$.ajax({
type: "GET",
url: "words.php",
dataType: "HTML",
error: function(){
alert('Error loading XML document');
},
success: function(data){
alert("Data Loaded: " + data);
}
 });

And i get this error:

missing } after function body
http://localhost/magnet/
Line 31

Any ideas why? All of my {} and () seem to match up?

Thanks so much!
Ryan


[jQuery] GET? Print out results via jquery/php

2007-12-26 Thread coughlinsmyalias

Hey all, I am wondering how I can get my results via php/ajax. Could i
use jquery for that print them out like this:

'.$word.'

And print them all out like that above. Would I use the GET function
with jquery. Get them all printed out.

Thanks so much!


[jQuery] Re: Adding result to database via php/jQuery - similar to tag feature on flickr

2007-12-26 Thread coughlinsmyalias

$.ajax({
 type: "POST",
 url: "add.php",
 data: {"word": $("#word").blah.value}
})

I have this now, it sends to my database..but I need to find a way to
now print out the result, I have it printing out via my php while
loop. should i do this through ajax instead?

How would I added to my script to make it say:

Word added and t hen show word.

Thanks!

On Dec 25, 9:35 pm, coughlinsmyalias <[EMAIL PROTECTED]> wrote:
> Hey all,
>
> I have been looking on google and on the jquery site for a function/
> plugin that will allow me to do:
>
> Have a form with one field that on submit will add the word to the
> page instantly via ajax/php send the request to the database and post
> to the table then display a message like "Word has been added"
>
> I have come up blank on my search and thought i'd post here. Any
> thoughts?
>
> So after they submit it shows on page, instantly.
>
> Thanks so much and happy holidays,
>
> Ryan


[jQuery] ajax function - php - display result

2007-12-26 Thread coughlinsmyalias

Hey all and happy holidays!

I have this code:

$.ajax({
 type: "POST",
 url: "add.php",
 data: {"word": $("#word").blah.value}
})

That sends it fine to my database and will print on page refresh...i
am curious to how I would use it to print out say "Word added." And
then display it on the page.

Right now I have my data being loaded via a php while() loop would it
be better to do this via ajax?

Thanks so much,

Ryan




[jQuery] Working with the ajax function

2007-12-25 Thread coughlinsmyalias

Hey all, i have this:

$.ajax({
type: "POST",
url: "add.php",
data: "word": $("#word").blah.value,
})

And I get this error:

missing } after property list
http://localhost/magnet/?addWord=ryan&submit=Add
Line 17

Any idea why? And my goal is to fill out the form hit submit then
display the value on the page instantly. Will this do this?

And where i have "blah" that changes to "word" correct, here is my
form:

Add Word:




Any thoughts?

Thank you so much,
Ryan


[jQuery] Displaying results over page

2007-12-25 Thread coughlinsmyalias

Hey, I am using php to generate the items on this page that you can
drag:

http://rksdesignstudios.com/magnet/

And I am wondering how i can go about on page load they will be
displayed all over the page, randomly not in a line like it is above.
I have checked google and jquery for plugins and nothing came up. Any
thoughts?

Thank you so much in advance,

Ryan


[jQuery] Working with selectables and draggables

2007-12-25 Thread coughlinsmyalias

Hey all! Happy Holidays, I am trying to combine both selectable
effects and draggables.

I have this:


$(document).ready(function() {
$(".word").draggable({grid: [50,50]});
});
$(window).bind("load",function(){
$("#wrapper").selectable();
});


I am going to have multiple classes to select that are span elements
with the class .word as you see above and I want to be able to select
them and also drag them all.

Any ideas?

Thanks in advance,

Ryan


[jQuery] Adding result to database via php/jQuery - similar to tag feature on flickr

2007-12-25 Thread coughlinsmyalias

Hey all,

I have been looking on google and on the jquery site for a function/
plugin that will allow me to do:

Have a form with one field that on submit will add the word to the
page instantly via ajax/php send the request to the database and post
to the table then display a message like "Word has been added"

I have come up blank on my search and thought i'd post here. Any
thoughts?

So after they submit it shows on page, instantly.

Thanks so much and happy holidays,

Ryan