RE: (ot) jQuery question

2010-12-12 Thread Rick Faircloth

Thanks, Matt! :o)

Rick

-Original Message-
From: Matt Quackenbush [mailto:quackfu...@gmail.com] 
Sent: Sunday, December 12, 2010 12:45 PM
To: cf-talk
Subject: Re: (ot) jQuery question


In Charlie's example, 'i' is the current index position of the each loop,
while 'o' is the current item (or object) of the index.  And yes, they are
arguments passed into the function.




~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340024
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: (ot) jQuery question

2010-12-12 Thread Rick Faircloth

Thanks, Charlie.

I couldn't see why the other code wouldn't work
properly either.

But I'm glad to be making some progress! :o)

Rick

-Original Message-
From: Charlie Griefer [mailto:charlie.grie...@gmail.com] 
Sent: Sunday, December 12, 2010 12:45 PM
To: cf-talk
Subject: Re: (ot) jQuery question


You don't need the i or o arguments for the code I posted.  They were
remnants from copying your original code.

>From the docs (http://api.jquery.com/each/):

.each( function(index, Element) )

so the first argument is the index.  .each() is looping over an array
(the array of selected DOM elements), so for each iteration, 'i' (or
whatever argument you declare) would be the position in the array of
the current element.

The second argument is the element itself, which can optionally be
passed in.  Not sure why I couldn't get it to work using "o" rather
than creating a new instance of $( this ) for each iteration... I'd
imagine passing the element in would be more performant, but probably
not enough of a difference to be noticeable.

On Sun, Dec 12, 2010 at 10:32 AM, Rick Faircloth
 wrote:
>
> Thanks, Charlie!  That gives me the correct output.
> Now I can move on to the AJAX, JSON, and CF CFC processing
> of data.
>
> Would you be so kind as to actually explain what function
> the "i" and "o" play in "function(i,o)" ?  They're variables/values
> passed into the function, right?
>
> I tested their necessity by taking them out of your
> code and just using function() instead of function(i,o)
> and the code still ran the same.  And even some of the
> example code I found performing this kind of functionality for lists
> used both i and o in the (), but only referenced the "o"
> in the actual function.
>
> I've always been confused about the role these variables
> playing in function(i,o) and whatever was in the ().
> Does the first argument (in this case, "i") always mean something
> specific because it's in the first argument position?  And the
> same with the variable that's in the second position?
>
> I scoured the Internet trying to get a good explanation of using
> these arguments, but haven't found what I needed to understand.
>
> Thanks for any insight you'd share!
>
> Rick
>
>
> -Original Message-
> From: Charlie Griefer [mailto:charlie.grie...@gmail.com]
> Sent: Saturday, December 11, 2010 10:51 PM
> To: cf-talk
> Subject: Re: (ot) jQuery question
>
>
> You're missing a # in your selector for #myTable.
> Even with the #, couldn't get your code to run... but the following
> seems to work:
>
> $( document ).ready( function() {
>        var staffOrder = "";
>
>        $( '#myTable tr' ).each( function( i,o ) {
>                if ( staffOrder.length ) {
>                        staffOrder += "," + $( this ).attr( 'class' );
>                } else {
>                        staffOrder = $( this ).attr( 'class' );
>                }
>        });
>
>        alert('staffOrder = ' + staffOrder);
> });
>
> On Sat, Dec 11, 2010 at 8:36 PM, Rick Faircloth
>  wrote:
>>
>> Hope some of you jQuery and CF users can answer what
>> seems to me should be an easy question, but I can't
>> figure out how to write this jQuery to product a list
>> of values.  (I'll use AJAX and JSON to send the value list
>> to a cffunction for processing).
>>
>> Given this HTML:
>>
>>        
>>
>>                
>>                        1
>>                
>>
>>                
>>                        2
>>                
>>
>>                
>>                        3
>>                
>>
>>                
>>                        4
>>                
>>
>>                
>>                        5
>>                
>>
>>        
>>
>> How can I modify this jQuery to produce
>> a list of the classes of the tr's above?
>>
>> (Output I'm looking for is "1,2,3,4,5" .)
>>
>> I get "staffOrder = " in the alert.  It's as if
>> the "each" function below isn't working at all.
>>
>> Suggestions?
>>
>> Thanks!
>>
>> Rick
>>
>>
>>        $(document).ready(function() {
>>
>>                var staffOrder = '';
>>
>>                $('myTable tr').each(function(i,o) {
>>
>>                        if      (       staffOrder.length
>> )
>>                                {       staffOrder += ',' + o.class;
>> }
>>                        else    {       staffOrder = o.class
>> }
>>
>>                });
>>
>>                alert('staffOrder = ' + staffOrder);
>>
>>        });
>>
>>
>>
>>
>>
>>
>
>
>
> 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340023
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: (ot) jQuery question

2010-12-12 Thread Rick Faircloth

Thanks for the link, Raj.

After I work through those examples, it looks
like the use of those variable should be clear.
(Or at least clearer!) :o)

Rick

-Original Message-
From: Raj Vijay [mailto:vraajku...@rediffmail.com] 
Sent: Sunday, December 12, 2010 12:36 PM
To: cf-talk
Subject: Re: (ot) jQuery question


Hi Rick,
 Take a look at the following jQuery Doc link http://api.jquery.com/each/
The order of the parameters matter. 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340022
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: (ot) jQuery question

2010-12-12 Thread Matt Quackenbush

In Charlie's example, 'i' is the current index position of the each loop,
while 'o' is the current item (or object) of the index.  And yes, they are
arguments passed into the function.


~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340021
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: (ot) jQuery question

2010-12-12 Thread Charlie Griefer

You don't need the i or o arguments for the code I posted.  They were
remnants from copying your original code.

>From the docs (http://api.jquery.com/each/):

.each( function(index, Element) )

so the first argument is the index.  .each() is looping over an array
(the array of selected DOM elements), so for each iteration, 'i' (or
whatever argument you declare) would be the position in the array of
the current element.

The second argument is the element itself, which can optionally be
passed in.  Not sure why I couldn't get it to work using "o" rather
than creating a new instance of $( this ) for each iteration... I'd
imagine passing the element in would be more performant, but probably
not enough of a difference to be noticeable.

On Sun, Dec 12, 2010 at 10:32 AM, Rick Faircloth
 wrote:
>
> Thanks, Charlie!  That gives me the correct output.
> Now I can move on to the AJAX, JSON, and CF CFC processing
> of data.
>
> Would you be so kind as to actually explain what function
> the "i" and "o" play in "function(i,o)" ?  They're variables/values
> passed into the function, right?
>
> I tested their necessity by taking them out of your
> code and just using function() instead of function(i,o)
> and the code still ran the same.  And even some of the
> example code I found performing this kind of functionality for lists
> used both i and o in the (), but only referenced the "o"
> in the actual function.
>
> I've always been confused about the role these variables
> playing in function(i,o) and whatever was in the ().
> Does the first argument (in this case, "i") always mean something
> specific because it's in the first argument position?  And the
> same with the variable that's in the second position?
>
> I scoured the Internet trying to get a good explanation of using
> these arguments, but haven't found what I needed to understand.
>
> Thanks for any insight you'd share!
>
> Rick
>
>
> -Original Message-
> From: Charlie Griefer [mailto:charlie.grie...@gmail.com]
> Sent: Saturday, December 11, 2010 10:51 PM
> To: cf-talk
> Subject: Re: (ot) jQuery question
>
>
> You're missing a # in your selector for #myTable.
> Even with the #, couldn't get your code to run... but the following
> seems to work:
>
> $( document ).ready( function() {
>        var staffOrder = "";
>
>        $( '#myTable tr' ).each( function( i,o ) {
>                if ( staffOrder.length ) {
>                        staffOrder += "," + $( this ).attr( 'class' );
>                } else {
>                        staffOrder = $( this ).attr( 'class' );
>                }
>        });
>
>        alert('staffOrder = ' + staffOrder);
> });
>
> On Sat, Dec 11, 2010 at 8:36 PM, Rick Faircloth
>  wrote:
>>
>> Hope some of you jQuery and CF users can answer what
>> seems to me should be an easy question, but I can't
>> figure out how to write this jQuery to product a list
>> of values.  (I'll use AJAX and JSON to send the value list
>> to a cffunction for processing).
>>
>> Given this HTML:
>>
>>        
>>
>>                
>>                        1
>>                
>>
>>                
>>                        2
>>                
>>
>>                
>>                        3
>>                
>>
>>                
>>                        4
>>                
>>
>>                
>>                        5
>>                
>>
>>        
>>
>> How can I modify this jQuery to produce
>> a list of the classes of the tr's above?
>>
>> (Output I'm looking for is "1,2,3,4,5" .)
>>
>> I get "staffOrder = " in the alert.  It's as if
>> the "each" function below isn't working at all.
>>
>> Suggestions?
>>
>> Thanks!
>>
>> Rick
>>
>>
>>        $(document).ready(function() {
>>
>>                var staffOrder = '';
>>
>>                $('myTable tr').each(function(i,o) {
>>
>>                        if      (       staffOrder.length
>> )
>>                                {       staffOrder += ',' + o.class;
>> }
>>                        else    {       staffOrder = o.class
>> }
>>
>>                });
>>
>>                alert('staffOrder = ' + staffOrder);
>>
>>        });
>>
>>
>>
>>
>>
>>
>
>
>
> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340020
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: (ot) jQuery question

2010-12-12 Thread Raj Vijay

Hi Rick,
 Take a look at the following jQuery Doc link http://api.jquery.com/each/
The order of the parameters matter. 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340019
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


RE: (ot) jQuery question

2010-12-12 Thread Rick Faircloth

Thanks, Charlie!  That gives me the correct output.
Now I can move on to the AJAX, JSON, and CF CFC processing
of data.

Would you be so kind as to actually explain what function
the "i" and "o" play in "function(i,o)" ?  They're variables/values
passed into the function, right?

I tested their necessity by taking them out of your
code and just using function() instead of function(i,o)
and the code still ran the same.  And even some of the
example code I found performing this kind of functionality for lists
used both i and o in the (), but only referenced the "o"
in the actual function.

I've always been confused about the role these variables
playing in function(i,o) and whatever was in the ().
Does the first argument (in this case, "i") always mean something
specific because it's in the first argument position?  And the
same with the variable that's in the second position?

I scoured the Internet trying to get a good explanation of using
these arguments, but haven't found what I needed to understand.

Thanks for any insight you'd share!

Rick


-Original Message-
From: Charlie Griefer [mailto:charlie.grie...@gmail.com] 
Sent: Saturday, December 11, 2010 10:51 PM
To: cf-talk
Subject: Re: (ot) jQuery question


You're missing a # in your selector for #myTable.
Even with the #, couldn't get your code to run... but the following
seems to work:

$( document ).ready( function() {
var staffOrder = "";

$( '#myTable tr' ).each( function( i,o ) {
if ( staffOrder.length ) {
staffOrder += "," + $( this ).attr( 'class' );
} else {
staffOrder = $( this ).attr( 'class' );
}
});

alert('staffOrder = ' + staffOrder);
});

On Sat, Dec 11, 2010 at 8:36 PM, Rick Faircloth
 wrote:
>
> Hope some of you jQuery and CF users can answer what
> seems to me should be an easy question, but I can't
> figure out how to write this jQuery to product a list
> of values.  (I'll use AJAX and JSON to send the value list
> to a cffunction for processing).
>
> Given this HTML:
>
>        
>
>                
>                        1
>                
>
>                
>                        2
>                
>
>                
>                        3
>                
>
>                
>                        4
>                
>
>                
>                        5
>                
>
>        
>
> How can I modify this jQuery to produce
> a list of the classes of the tr's above?
>
> (Output I'm looking for is "1,2,3,4,5" .)
>
> I get "staffOrder = " in the alert.  It's as if
> the "each" function below isn't working at all.
>
> Suggestions?
>
> Thanks!
>
> Rick
>
>
>        $(document).ready(function() {
>
>                var staffOrder = '';
>
>                $('myTable tr').each(function(i,o) {
>
>                        if      (       staffOrder.length
> )
>                                {       staffOrder += ',' + o.class;
> }
>                        else    {       staffOrder = o.class
> }
>
>                });
>
>                alert('staffOrder = ' + staffOrder);
>
>        });
>
>
>
>
>
> 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340018
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: (ot) jQuery question

2010-12-11 Thread Charlie Griefer

You're missing a # in your selector for #myTable.
Even with the #, couldn't get your code to run... but the following
seems to work:

$( document ).ready( function() {
var staffOrder = "";

$( '#myTable tr' ).each( function( i,o ) {
if ( staffOrder.length ) {
staffOrder += "," + $( this ).attr( 'class' );
} else {
staffOrder = $( this ).attr( 'class' );
}
});

alert('staffOrder = ' + staffOrder);
});

On Sat, Dec 11, 2010 at 8:36 PM, Rick Faircloth
 wrote:
>
> Hope some of you jQuery and CF users can answer what
> seems to me should be an easy question, but I can't
> figure out how to write this jQuery to product a list
> of values.  (I'll use AJAX and JSON to send the value list
> to a cffunction for processing).
>
> Given this HTML:
>
>        
>
>                
>                        1
>                
>
>                
>                        2
>                
>
>                
>                        3
>                
>
>                
>                        4
>                
>
>                
>                        5
>                
>
>        
>
> How can I modify this jQuery to produce
> a list of the classes of the tr's above?
>
> (Output I'm looking for is "1,2,3,4,5" .)
>
> I get "staffOrder = " in the alert.  It's as if
> the "each" function below isn't working at all.
>
> Suggestions?
>
> Thanks!
>
> Rick
>
>
>        $(document).ready(function() {
>
>                var staffOrder = '';
>
>                $('myTable tr').each(function(i,o) {
>
>                        if      (       staffOrder.length
> )
>                                {       staffOrder += ',' + o.class;
> }
>                        else    {       staffOrder = o.class
> }
>
>                });
>
>                alert('staffOrder = ' + staffOrder);
>
>        });
>
>
>
>
>
> 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340013
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


(ot) jQuery question

2010-12-11 Thread Rick Faircloth

Hope some of you jQuery and CF users can answer what
seems to me should be an easy question, but I can't
figure out how to write this jQuery to product a list
of values.  (I'll use AJAX and JSON to send the value list
to a cffunction for processing).

Given this HTML:



  
1



2



3



4



5




How can I modify this jQuery to produce
a list of the classes of the tr's above?

(Output I'm looking for is "1,2,3,4,5" .)

I get "staffOrder = " in the alert.  It's as if
the "each" function below isn't working at all.

Suggestions?

Thanks!

Rick


$(document).ready(function() {

var staffOrder = '';

$('myTable tr').each(function(i,o) {

if  (   staffOrder.length
)
{   staffOrder += ',' + o.class;
}
else{   staffOrder = o.class
}

});

alert('staffOrder = ' + staffOrder);

});





~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:340012
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: jQuery question

2009-08-12 Thread Dave l

you can hit the cfc directly just fine and you did the right thing by setting 
the returntype in the call instead of in the cfc so you can reuse the cfc 
without returning just json.

Are you sending a form or hard coded info?

BTW~ jquery doesn't handle json very much, they have a getJson tag which is 
useless if you want to gather info back from an ajax call since it asks for the 
file.

if you are sending a form then serialize it and it gathers the fields and sends 
it which will be a struct the same as a reg form

$.ajax({
type: 'post',
url: '/cfc/users.cfc?method=addUser&returnFormat=json',
data: $("form").serialize(),


or with vars

var password = $('input[name=password]');
var password2 = $('input[name=password2]');
var data = 'password=' + password.val() + '&password2=' + 
password2.val()

$.ajax({
url: 
"/admin/cfc/system.cfc?method=checkPassword&returnFormat=plain",   
type: "post",   
data: data, 





~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325381
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: jQuery question

2009-08-12 Thread Dominic Watson

That's not saying you should do what I do or that hitting the cfc directly
is bad - just saying how I solve the problem you are having...

However, is it absolutely neccessary for the cfc method to take a struct as
its single argument? Could you define no arguments at all and use the
arguments scope in the same way you are using the struct that you're passing
currently?

Dominic

2009/8/12 Dominic Watson 

> My personal preference is not to hit cfc's directly. Instead, I use a
> framework (ModelGlue, Fusebox, etc) for *every* request, be it an ajax one
> or anything else. My cfc method just knows that it gets given a load of data
> and it returns a load of data - it does not need to worry about the output
> format of that data. The framework can then get the data it needs and spit
> it out in the way asked of it (ie. json, xml, html, etc).
>


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325372
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: jQuery question

2009-08-12 Thread Dominic Watson

jQuery was not the problem here. CF knowing what to do with your post
variables was.

My personal preference is not to hit cfc's directly. Instead, I use a
framework (ModelGlue, Fusebox, etc) for *every* request, be it an ajax one
or anything else. My cfc method just knows that it gets given a load of data
and it returns a load of data - it does not need to worry about the output
format of that data. The framework can then get the data it needs and spit
it out in the way asked of it (ie. json, xml, html, etc).

But that's all besides the point I guess ;)

Dominic

Man, I figured since jQuery requires you to "code less", it would do
> that for me automatically, knowing that it can't pass a complex object
> directly.
>


~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325371
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: jQuery question

2009-08-11 Thread Rick Root

On Tue, Aug 11, 2009 at 8:25 PM, Josh Nathanson wrote:
>
> Like any other form post, you can't pass complex arguments to the server.
> What you could do is pass a JSON string and then deserialize it in the CFC.

Man, I figured since jQuery requires you to "code less", it would do
that for me automatically, knowing that it can't pass a complex object
directly.

Okay... so a json string in this case would be something like:

var command = '{"name":""}';

and then set my argument type to "any" and deserialize if it's json.

seems to work.

Thanks!

-- 
Rick Root
New Brian Vander Ark Album, songs in the music player and cool behind
the scenes video at www.myspace.com/brianvanderark

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325360
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: jQuery question

2009-08-11 Thread Josh Nathanson

Hey Rick,

Like any other form post, you can't pass complex arguments to the server.
What you could do is pass a JSON string and then deserialize it in the CFC.

-- Josh


-Original Message-
From: Rick Root [mailto:rick.r...@webworksllc.com] 
Sent: Tuesday, August 11, 2009 5:09 PM
To: cf-talk
Subject: jQuery question


I have a CFC hat accepts a struct as its argument.  The struct can
contain 0 or more items, but the struct itself is required.

I want to use jQuery to call this method.  But I can't figure out how.
 what I'm trying to do is this:

I'm trying to do this as a jquery post...

var command = {name:''};
var url='/cfcs/pools.cfc?method=getPoolList&returnFormat=json';
$.post(url, [command:command], rh_getPoolList, "json");

it is successfully calling the CFC - I have a cfmail in it that emails
me a dump of the arguments.

And arguments.command is a string that looks like this:   [object object]

Instead of a struct.

Any suggestions?
-- 
Rick Root
New Brian Vander Ark Album, songs in the music player and cool behind
the scenes video at www.myspace.com/brianvanderark



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325359
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


jQuery question

2009-08-11 Thread Rick Root

I have a CFC hat accepts a struct as its argument.  The struct can
contain 0 or more items, but the struct itself is required.

I want to use jQuery to call this method.  But I can't figure out how.
 what I'm trying to do is this:

I'm trying to do this as a jquery post...

var command = {name:''};
var url='/cfcs/pools.cfc?method=getPoolList&returnFormat=json';
$.post(url, [command:command], rh_getPoolList, "json");

it is successfully calling the CFC - I have a cfmail in it that emails
me a dump of the arguments.

And arguments.command is a string that looks like this:   [object object]

Instead of a struct.

Any suggestions?
-- 
Rick Root
New Brian Vander Ark Album, songs in the music player and cool behind
the scenes video at www.myspace.com/brianvanderark

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325358
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: jquery question

2009-06-06 Thread Mike Little

thanks azadi, this looks very much like what i am trying to achieve.

mike 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323221
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: jquery question

2009-06-04 Thread Andy Matthews

Just write the contents of the textarea into the html of the target.
 

-Original Message-
From: Mike Little [mailto:m...@nzsolutions.co.nz] 
Sent: Wednesday, June 03, 2009 7:03 PM
To: cf-talk
Subject: Re: jquery question


thanks guys,

my question is though - how to pass formatted content from my textarea to
the div upon form submission (or another button submit). ultimately i would
like to pass the content to a cfc first to check and amend data as required
so this is why i thought jquery would be the way to go.

mike 



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323159
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: jquery question

2009-06-04 Thread Andy Matthews

I'll second the use of Pretty Photo. I just put it in place on my site for
Flash modal windows and it works awesome. Super easy to install as well. You
can see it in action here (click the watch video):

http://andymatthews.net/read/2009/05/26/jQuery-and-AIR:-Creating-a-new-AIR-p
roject-in-Aptana



andy 

-Original Message-
From: Charlie Griefer [mailto:charlie.grie...@gmail.com] 
Sent: Wednesday, June 03, 2009 5:54 PM
To: cf-talk
Subject: Re: jquery question


check out one of the many jquery lightbox clones.

http://www.no-margin-for-errors.com/projects/prettyPhoto-jquery-lightbox-clo
ne/
http://www.stickmanlabs.com/lightwindow/


On Wed, Jun 3, 2009 at 3:42 PM, Mike Little  wrote:

>
> sorry, could not think of a better subject!
>
> i have a form which an admin enters a embed script such as a youtube
video.
> what i would like to achieve is to have a preview button which takes 
> the contents of the textarea (ultimately filters the content with my 
> clever param filter) and displays the output in a popup similar to...
>
> http://yensdesign.com/tutorials/popupjquery/
>
> (or alternatively the output displays in a div below the textarea?)
>
> i am very new to jquery/ajax and really would like to get into it.
> unfortunately we have issues with using cf8's ajax features on my 
> hosts shared server and would like to use native jquery/ajax.
>
> any help/pointers in the right direction would be really appreciated.
>
> mike
>
> 



~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323158
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: jquery question

2009-06-03 Thread Azadi Saryev

1) make sure your cfc function that processes the textarea content has
access="remote"
2) create a button on your page to click to pass the textarea content to
your cfc function
3) add onclick="showContent('id-of-your-textarea-here');" to this button
(replace 'id-of-your-textarea-here' with actual ID of your textarea!)
4) put this showContent js function into HEAD section of your page,
making any necessary changes to it as per comments:


var showContent = function(id) {
 $.get(

"path/to/yourcfc.cfc?method=yourCfcFunctionName&content="+$("#"+id).val(),
// amend as necessary
  function(data) {
   //code here to do whatever you need with returned formatted content
   //the returned content will be in js variable 'data'
  },
  'json' // change to data type of returnformat of your cfc fucntion
 );
};


hth

Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/


On 04/06/2009 07:03, Mike Little wrote:
> thanks guys,
> 
> my question is though - how to pass formatted content from my textarea to the 
> div upon form submission (or another button submit). ultimately i would like 
> to pass the content to a cfc first to check and amend data as required so 
> this is why i thought jquery would be the way to go.
> 
> mike 
> 
> 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323148
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: jquery question

2009-06-03 Thread Ryan Letulle

Sorry Mike.
I guess I'm not fully understanding where your problem is if you are going
to submit form data.

Do you want the lightbox to appear automatically after the form is
submitted?  Why can't you process the submission normally?  or are you
looking to just submit the script through jquery (i.e load or ajax) to
another page and make something happen on your page after it is tweeked?

I was not aware that jQuery could communicate directly with a cfc but I am
sure someone hear could get that going.  I have always communicated with a
cfm page which might invoke a cfc.

--
Ryan



On Wed, Jun 3, 2009 at 7:03 PM, Mike Little  wrote:

>
> thanks guys,
>
> my question is though - how to pass formatted content from my textarea to
> the div upon form submission (or another button submit). ultimately i would
> like to pass the content to a cfc first to check and amend data as required
> so this is why i thought jquery would be the way to go.
>
> mike
>
> 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323146
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: jquery question

2009-06-03 Thread Mike Little

thanks guys,

my question is though - how to pass formatted content from my textarea to the 
div upon form submission (or another button submit). ultimately i would like to 
pass the content to a cfc first to check and amend data as required so this is 
why i thought jquery would be the way to go.

mike 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323143
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: jquery question

2009-06-03 Thread Ryan Letulle

I usually choose Thickbox for a lightbox feature.  Not the best looking out
of the box but very functional and you can always style it.
--
Ryan



On Wed, Jun 3, 2009 at 5:54 PM, Charlie Griefer
wrote:

>
> check out one of the many jquery lightbox clones.
>
>
> http://www.no-margin-for-errors.com/projects/prettyPhoto-jquery-lightbox-clone/
> http://www.stickmanlabs.com/lightwindow/
>
>
> On Wed, Jun 3, 2009 at 3:42 PM, Mike Little 
> wrote:
>
> >
> > sorry, could not think of a better subject!
> >
> > i have a form which an admin enters a embed script such as a youtube
> video.
> > what i would like to achieve is to have a preview button which takes the
> > contents of the textarea (ultimately filters the content with my clever
> > param filter) and displays the output in a popup similar to...
> >
> > http://yensdesign.com/tutorials/popupjquery/
> >
> > (or alternatively the output displays in a div below the textarea?)
> >
> > i am very new to jquery/ajax and really would like to get into it.
> > unfortunately we have issues with using cf8's ajax features on my hosts
> > shared server and would like to use native jquery/ajax.
> >
> > any help/pointers in the right direction would be really appreciated.
> >
> > mike
> >
> >
>
> 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323138
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: jquery question

2009-06-03 Thread Charlie Griefer

check out one of the many jquery lightbox clones.

http://www.no-margin-for-errors.com/projects/prettyPhoto-jquery-lightbox-clone/
http://www.stickmanlabs.com/lightwindow/


On Wed, Jun 3, 2009 at 3:42 PM, Mike Little  wrote:

>
> sorry, could not think of a better subject!
>
> i have a form which an admin enters a embed script such as a youtube video.
> what i would like to achieve is to have a preview button which takes the
> contents of the textarea (ultimately filters the content with my clever
> param filter) and displays the output in a popup similar to...
>
> http://yensdesign.com/tutorials/popupjquery/
>
> (or alternatively the output displays in a div below the textarea?)
>
> i am very new to jquery/ajax and really would like to get into it.
> unfortunately we have issues with using cf8's ajax features on my hosts
> shared server and would like to use native jquery/ajax.
>
> any help/pointers in the right direction would be really appreciated.
>
> mike
>
> 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323137
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: jquery question

2009-06-03 Thread Ryan Letulle

Shouldn't be hard at all to have a hidden div prepared.  After the text area
is changed put the script in the div (getelementbyid) and show the div.
I don't think you need ajax for that.  You could certainly write it in
jQuery syntax but any old javascript should do that.  I've never tested it
but I think it should work unless there is some issue with the script you
are pasting.

--
Ryan



On Wed, Jun 3, 2009 at 5:42 PM, Mike Little  wrote:

>
> sorry, could not think of a better subject!
>
> i have a form which an admin enters a embed script such as a youtube video.
> what i would like to achieve is to have a preview button which takes the
> contents of the textarea (ultimately filters the content with my clever
> param filter) and displays the output in a popup similar to...
>
> http://yensdesign.com/tutorials/popupjquery/
>
> (or alternatively the output displays in a div below the textarea?)
>
> i am very new to jquery/ajax and really would like to get into it.
> unfortunately we have issues with using cf8's ajax features on my hosts
> shared server and would like to use native jquery/ajax.
>
> any help/pointers in the right direction would be really appreciated.
>
> mike
>
> 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323136
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


jquery question

2009-06-03 Thread Mike Little

sorry, could not think of a better subject!

i have a form which an admin enters a embed script such as a youtube video. 
what i would like to achieve is to have a preview button which takes the 
contents of the textarea (ultimately filters the content with my clever param 
filter) and displays the output in a popup similar to...

http://yensdesign.com/tutorials/popupjquery/

(or alternatively the output displays in a div below the textarea?)

i am very new to jquery/ajax and really would like to get into it. 
unfortunately we have issues with using cf8's ajax features on my hosts shared 
server and would like to use native jquery/ajax.

any help/pointers in the right direction would be really appreciated.

mike 

~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:323134
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4