Re: Mixing CF and JavaScript.

2006-11-14 Thread Jake Churchill
You need to use AJAX.  Basically, inside your lookUpUPC() function you 
will make a call to a CFC that does the query and hands it back to the 
javascript function to pupulate fields.  Look into CFAjax. 

Jason T. Slack wrote:
 I am on Day 5 with CF and Coming along nicely.

 I have a question on mixing CF and Javascript.

 Say I have the following with an onBlur event:

 input type=textfield name=upc id=upc size=12 maxlength=12  
 onblur=lookUpUPC(this.value); /

 Here is the JS for LookUpUPC()

 function lookUpUPC(upc)
 { 
   cfquery name=ckUPC datasource=#application.dsn#
   SELECT Description, UnitPrice FROM Inventoryitems
WHERE upc = Cfqueryparam cfsqltype=cf_sql_varchar
   value=upc;
   /cfquery

   cfif ckUPC.recordCount EQ 1
   alert(UPC FOUND);
   cfelse
   alert(UPC NOT FOUND);
   /cfif
 }


 When LookUpUPC fires I get just the alert boxes that I coded in for  
 information purposes. I tried hard coding the query with a valid upc  
 in the database and still I get UPC not found.

 So I must be doing something wrong but I am not sure what.

 Can anybody shed some light?

 -Jason





 

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260372
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Mixing CF and JavaScript.

2006-11-14 Thread Rob Wilkerson
On 11/14/06, Jason T. Slack [EMAIL PROTECTED] wrote:
 I am on Day 5 with CF and Coming along nicely.

 I have a question on mixing CF and Javascript.

 Say I have the following with an onBlur event:

 input type=textfield name=upc id=upc size=12 maxlength=12
 onblur=lookUpUPC(this.value); /

 Here is the JS for LookUpUPC()

 function lookUpUPC(upc)
 {
 cfquery name=ckUPC datasource=#application.dsn#
 SELECT Description, UnitPrice FROM Inventoryitems
  WHERE upc = Cfqueryparam cfsqltype=cf_sql_varchar
 value=upc;
 /cfquery

 cfif ckUPC.recordCount EQ 1
 alert(UPC FOUND);
 cfelse
 alert(UPC NOT FOUND);
 /cfif
 }


 When LookUpUPC fires I get just the alert boxes that I coded in for
 information purposes. I tried hard coding the query with a valid upc
 in the database and still I get UPC not found.

 So I must be doing something wrong but I am not sure what.

 Can anybody shed some light?

In my opinion, this is one of the hardest things for new CFers to
understand.  The key here is that the ColdFusion code is rendered
server-side and the javascript is executed client-side.  For you, this
means that you can't do what you're trying to do the way you're trying
to do it.  You're trying to execute server code in a client function.
You can accomplish the mission using AJaX, but not through inline
methods like these.

HTH.

Rob Wilkerson

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260373
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Mixing CF and JavaScript.

2006-11-14 Thread Ian Skinner
So I must be doing something wrong but I am not sure what.

Can anybody shed some light?

-Jason

ColdFusion runs on the server and Javascript runs on the client and the two 
don't mix.

Ok, they can be made to look like they mix with Ajax and other techniques, but 
this isn't beginner stuff.  

The first way you could do what you want is with the CFWDDX... tag.  It can 
take the query and change it into a JS array; you then look up the values in 
the array.  This gets heavy if the recordset is larger and exposes all the data 
to the user, so it is not often used.




--
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

-
| 1 |   |
-  Binary Soduko
|   |   |
-
 
C code. C code run. Run code run. Please!
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message. 




~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260376
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Mixing CF and JavaScript.

2006-11-14 Thread Munson, Jacob
 You need to use AJAX.

I agree, but I wouldn't recommend CFAjax.  It's outdated, and the guy
that wrote it has moved on to MXAjax:
http://www.indiankey.com/mxajax/

Personally I prefer ajaxCFC:
http://ajaxcfc.riaforge.org/



--
This transmission may contain information that is privileged, confidential 
and/or exempt from disclosure under applicable law. If you are not the intended 
recipient, you are hereby notified that any disclosure, copying, distribution, 
or use of the information contained herein (including any reliance thereon) is 
STRICTLY PROHIBITED. If you received this transmission in error, please 
immediately contact the sender and destroy the material in its entirety, 
whether in electronic or hard copy format. Thank you. 

==
EMF idahopower.com made the previous annotations.

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260377
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Mixing CF and JavaScript.

2006-11-14 Thread Charlie Griefer
ColdFusion is server side.  Once the page loads, CF is done.

JS is client side.  You can't reference CF code inside of JS after the
page loads (not without getting AJAX-y).

you can create JS variables with CF:

script type=text/javascript
 var myFoo = cfoutput#myQuery.foo#/cfoutput';
/script

if you view the source of that page after it loads, you'll see the JS
is valid.  it's identical to using CF to create HTML.

However, once the page loads, you can no longer rely on CF to create
any client side code.

To do what you want, you'd use CF to create a JS array and your
onclick would use that array.


On 11/14/06, Jason T. Slack [EMAIL PROTECTED] wrote:
 I am on Day 5 with CF and Coming along nicely.

 I have a question on mixing CF and Javascript.

 Say I have the following with an onBlur event:

 input type=textfield name=upc id=upc size=12 maxlength=12
 onblur=lookUpUPC(this.value); /

 Here is the JS for LookUpUPC()

 function lookUpUPC(upc)
 {
 cfquery name=ckUPC datasource=#application.dsn#
 SELECT Description, UnitPrice FROM Inventoryitems
  WHERE upc = Cfqueryparam cfsqltype=cf_sql_varchar
 value=upc;
 /cfquery

 cfif ckUPC.recordCount EQ 1
 alert(UPC FOUND);
 cfelse
 alert(UPC NOT FOUND);
 /cfif
 }


 When LookUpUPC fires I get just the alert boxes that I coded in for
 information purposes. I tried hard coding the query with a valid upc
 in the database and still I get UPC not found.

 So I must be doing something wrong but I am not sure what.

 Can anybody shed some light?

 -Jason





 

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260375
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Mixing CF and JavaScript.

2006-11-14 Thread Teddy Payne
Jason,
ColdFusion cannot be directly invoked from JavaScript without a interface to
call a service.

ColdFusion is processed and then the end result is passed through the web
server to your browser.  At that point essentially, the page is static.

If you want interactivity, you have to call another page or service to
activate CF enabled templates.  This is typically done in AJAX when using
JavaScript.  You can do this also in Flash with Flex.

Teddy

On 11/14/06, Jason T. Slack [EMAIL PROTECTED] wrote:

 I am on Day 5 with CF and Coming along nicely.

 I have a question on mixing CF and Javascript.

 Say I have the following with an onBlur event:

 input type=textfield name=upc id=upc size=12 maxlength=12
 onblur=lookUpUPC(this.value); /

 Here is the JS for LookUpUPC()

 function lookUpUPC(upc)
 {
 cfquery name=ckUPC datasource=#application.dsn#
 SELECT Description, UnitPrice FROM Inventoryitems
  WHERE upc = Cfqueryparam cfsqltype=cf_sql_varchar
 value=upc;
 /cfquery

 cfif ckUPC.recordCount EQ 1
 alert(UPC FOUND);
 cfelse
 alert(UPC NOT FOUND);
 /cfif
 }


 When LookUpUPC fires I get just the alert boxes that I coded in for
 information purposes. I tried hard coding the query with a valid upc
 in the database and still I get UPC not found.

 So I must be doing something wrong but I am not sure what.

 Can anybody shed some light?

 -Jason





 

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260378
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Mixing CF and JavaScript.

2006-11-14 Thread Ray Champagne
Don't you think that maybe suggesting AJAX or CFAJAX might be a little much
for this user at this point?  He did mention that he's on DAY 5 of CF
development, you know.

I like Charlie's idea.  Use CF to create the structure you're looking to
use, then use JS to do the lookup on that.

 -Original Message-
 From: Munson, Jacob [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, November 14, 2006 1:17 PM
 To: CF-Talk
 Subject: RE: Mixing CF and JavaScript.
 
  You need to use AJAX.
 
 I agree, but I wouldn't recommend CFAjax.  It's outdated, and the guy
 that wrote it has moved on to MXAjax:
 http://www.indiankey.com/mxajax/
 
 Personally I prefer ajaxCFC:
 http://ajaxcfc.riaforge.org/
 
 
 


--
 This transmission may contain information that is privileged, confidential
and/or
 exempt from disclosure under applicable law. If you are not the intended
 recipient, you are hereby notified that any disclosure, copying,
distribution, or
 use of the information contained herein (including any reliance thereon)
is
 STRICTLY PROHIBITED. If you received this transmission in error, please
 immediately contact the sender and destroy the material in its entirety,
whether
 in electronic or hard copy format. Thank you.
 
 ==
 
 EMF idahopower.com made the previous annotations.
 
 

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260380
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Mixing CF and JavaScript.

2006-11-14 Thread Charlie Griefer
yeah, that's why I threw in the mention of AJAX, but really didn't
pursue that as the solution.  He's probably got enough things on his
plate at the moment without introducing a new technology :)

On 11/14/06, Ray Champagne [EMAIL PROTECTED] wrote:
 Don't you think that maybe suggesting AJAX or CFAJAX might be a little much
 for this user at this point?  He did mention that he's on DAY 5 of CF
 development, you know.

 I like Charlie's idea.  Use CF to create the structure you're looking to
 use, then use JS to do the lookup on that.

  -Original Message-
  From: Munson, Jacob [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, November 14, 2006 1:17 PM
  To: CF-Talk
  Subject: RE: Mixing CF and JavaScript.
 
   You need to use AJAX.
 
  I agree, but I wouldn't recommend CFAjax.  It's outdated, and the guy
  that wrote it has moved on to MXAjax:
  http://www.indiankey.com/mxajax/
 
  Personally I prefer ajaxCFC:
  http://ajaxcfc.riaforge.org/
 
 
 
 
 
 --
  This transmission may contain information that is privileged, confidential
 and/or
  exempt from disclosure under applicable law. If you are not the intended
  recipient, you are hereby notified that any disclosure, copying,
 distribution, or
  use of the information contained herein (including any reliance thereon)
 is
  STRICTLY PROHIBITED. If you received this transmission in error, please
  immediately contact the sender and destroy the material in its entirety,
 whether
  in electronic or hard copy format. Thank you.
 
  ==
  
  EMF idahopower.com made the previous annotations.
 
 

 

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260383
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Mixing CF and JavaScript.

2006-11-14 Thread Munson, Jacob
Charlie and Ray,

You can't do what he wants without something like Ajax.  He is passing
the UPC to a query and then doing something with the results in
JavaScript.  Yes, you can create JS vars with CF, but if you want to hit
your DB like he's attempting, you'd use ajax or flash remoting.  

And comon', ajax is not very hard.  To do what he wants with ajaxCFC
would mean dropping the core files in, creating a basic CFC including
his cfquery, and then cfreturn the result.  I'd imagine it's similar in
mxajax.

 -Original Message-
 From: Charlie Griefer [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, November 14, 2006 11:42 AM
 To: CF-Talk
 Subject: Re: Mixing CF and JavaScript.
 
 yeah, that's why I threw in the mention of AJAX, but really didn't
 pursue that as the solution.  He's probably got enough things on his
 plate at the moment without introducing a new technology :)
 
 On 11/14/06, Ray Champagne [EMAIL PROTECTED] wrote:
  Don't you think that maybe suggesting AJAX or CFAJAX might 
 be a little much
  for this user at this point?  He did mention that he's on 
 DAY 5 of CF
  development, you know.
 
  I like Charlie's idea.  Use CF to create the structure 
 you're looking to
  use, then use JS to do the lookup on that.
 
   -Original Message-
   From: Munson, Jacob [mailto:[EMAIL PROTECTED]
   Sent: Tuesday, November 14, 2006 1:17 PM
   To: CF-Talk
   Subject: RE: Mixing CF and JavaScript.
  
You need to use AJAX.
  
   I agree, but I wouldn't recommend CFAjax.  It's outdated, 
 and the guy
   that wrote it has moved on to MXAjax:
   http://www.indiankey.com/mxajax/
  
   Personally I prefer ajaxCFC:
   http://ajaxcfc.riaforge.org/

--
This transmission may contain information that is privileged, confidential 
and/or exempt from disclosure under applicable law. If you are not the intended 
recipient, you are hereby notified that any disclosure, copying, distribution, 
or use of the information contained herein (including any reliance thereon) is 
STRICTLY PROHIBITED. If you received this transmission in error, please 
immediately contact the sender and destroy the material in its entirety, 
whether in electronic or hard copy format. Thank you. 

==
EMF idahopower.com made the previous annotations.

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260385
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Mixing CF and JavaScript.

2006-11-14 Thread Charlie Griefer
You can do exactly what he wants by loading the data into a JS array.
Then his function would simply look in the array rather than trying to
do a query.

the cfquery in his function is querying for a specific record based on
a value passed to the function.

if he does a query without the WHERE and loops over that query, he can
create a JS array easily.

On 11/14/06, Munson, Jacob [EMAIL PROTECTED] wrote:
 Charlie and Ray,

 You can't do what he wants without something like Ajax.  He is passing
 the UPC to a query and then doing something with the results in
 JavaScript.  Yes, you can create JS vars with CF, but if you want to hit
 your DB like he's attempting, you'd use ajax or flash remoting.

 And comon', ajax is not very hard.  To do what he wants with ajaxCFC
 would mean dropping the core files in, creating a basic CFC including
 his cfquery, and then cfreturn the result.  I'd imagine it's similar in
 mxajax.

  -Original Message-
  From: Charlie Griefer [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, November 14, 2006 11:42 AM
  To: CF-Talk
  Subject: Re: Mixing CF and JavaScript.
 
  yeah, that's why I threw in the mention of AJAX, but really didn't
  pursue that as the solution.  He's probably got enough things on his
  plate at the moment without introducing a new technology :)
 
  On 11/14/06, Ray Champagne [EMAIL PROTECTED] wrote:
   Don't you think that maybe suggesting AJAX or CFAJAX might
  be a little much
   for this user at this point?  He did mention that he's on
  DAY 5 of CF
   development, you know.
  
   I like Charlie's idea.  Use CF to create the structure
  you're looking to
   use, then use JS to do the lookup on that.
  
-Original Message-
From: Munson, Jacob [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 14, 2006 1:17 PM
To: CF-Talk
Subject: RE: Mixing CF and JavaScript.
   
 You need to use AJAX.
   
I agree, but I wouldn't recommend CFAjax.  It's outdated,
  and the guy
that wrote it has moved on to MXAjax:
http://www.indiankey.com/mxajax/
   
Personally I prefer ajaxCFC:
http://ajaxcfc.riaforge.org/

 --
 This transmission may contain information that is privileged, confidential 
 and/or exempt from disclosure under applicable law. If you are not the 
 intended recipient, you are hereby notified that any disclosure, copying, 
 distribution, or use of the information contained herein (including any 
 reliance thereon) is STRICTLY PROHIBITED. If you received this transmission 
 in error, please immediately contact the sender and destroy the material in 
 its entirety, whether in electronic or hard copy format. Thank you.

 ==
 EMF idahopower.com made the previous annotations.

 

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260388
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Mixing CF and JavaScript.

2006-11-14 Thread Rick Root
Jake Churchill wrote:
 Look into CFAjax. 

Don't look into CFAJAX unless you like outdated code with known security 
vulnerabilities that isn't being updated/maintained anymore.

ajaxCFC or mxajax or any variety of others, but absolutely not cfajax.

Rick

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260392
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Mixing CF and JavaScript.

2006-11-14 Thread Ian Skinner
if he does a query without the WHERE and loops over that query, he can create a 
JS array easily.

Even easier if he uses the cfwddx action=cfml2js ... tag, which will take a 
CF variable, simple or complex, and turn it into a corresponding JS variable.




--
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

-
| 1 |   |
-  Binary Soduko
|   |   |
-
 
C code. C code run. Run code run. Please!
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message. 




~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260393
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


RE: Mixing CF and JavaScript.

2006-11-14 Thread Ray Champagne
Why can't he hit the DB with CF, return a structure, and search on that?  I
guess I'm missing your point as to why he can't do what he wants without
having to use AJAX or Flash remoting or FLEX.

Like Charlie said, learning even what a CFC is and how to use it can be a
little bit daunting if you're still learning the little things that make
CF, well, CF.  

 -Original Message-
 From: Munson, Jacob [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, November 14, 2006 1:58 PM
 To: CF-Talk
 Subject: RE: Mixing CF and JavaScript.
 Importance: High
 
 Charlie and Ray,
 
 You can't do what he wants without something like Ajax.  He is passing
 the UPC to a query and then doing something with the results in
 JavaScript.  Yes, you can create JS vars with CF, but if you want to hit
 your DB like he's attempting, you'd use ajax or flash remoting.
 
 And comon', ajax is not very hard.  To do what he wants with ajaxCFC
 would mean dropping the core files in, creating a basic CFC including
 his cfquery, and then cfreturn the result.  I'd imagine it's similar in
 mxajax.
 
  -Original Message-
  From: Charlie Griefer [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, November 14, 2006 11:42 AM
  To: CF-Talk
  Subject: Re: Mixing CF and JavaScript.
 
  yeah, that's why I threw in the mention of AJAX, but really didn't
  pursue that as the solution.  He's probably got enough things on his
  plate at the moment without introducing a new technology :)
 
  On 11/14/06, Ray Champagne [EMAIL PROTECTED] wrote:
   Don't you think that maybe suggesting AJAX or CFAJAX might
  be a little much
   for this user at this point?  He did mention that he's on
  DAY 5 of CF
   development, you know.
  
   I like Charlie's idea.  Use CF to create the structure
  you're looking to
   use, then use JS to do the lookup on that.
  
-Original Message-
From: Munson, Jacob [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 14, 2006 1:17 PM
To: CF-Talk
Subject: RE: Mixing CF and JavaScript.
   
 You need to use AJAX.
   
I agree, but I wouldn't recommend CFAjax.  It's outdated,
  and the guy
that wrote it has moved on to MXAjax:
http://www.indiankey.com/mxajax/
   
Personally I prefer ajaxCFC:
http://ajaxcfc.riaforge.org/
 


--
 This transmission may contain information that is privileged, confidential
and/or
 exempt from disclosure under applicable law. If you are not the intended
 recipient, you are hereby notified that any disclosure, copying,
distribution, or
 use of the information contained herein (including any reliance thereon)
is
 STRICTLY PROHIBITED. If you received this transmission in error, please
 immediately contact the sender and destroy the material in its entirety,
whether
 in electronic or hard copy format. Thank you.
 
 ==
 
 EMF idahopower.com made the previous annotations.
 
 

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260396
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Mixing CF and JavaScript.

2006-11-14 Thread Charlie Griefer
On 11/14/06, Ian Skinner [EMAIL PROTECTED] wrote:
 if he does a query without the WHERE and loops over that query, he can create 
 a JS array easily.

 Even easier if he uses the cfwddx action=cfml2js ... tag, which will take 
 a CF variable, simple or complex, and turn it into a corresponding JS 
 variable.

Yes, that's much better (i don't know why i don't use that).  heh.

BTW, just to clarify...I wasn't trying to debate over which was
easier (the JS array vs AJAX), since easy is a relative term.  My
point was that it's possible to do without AJAX.


-- 
Charlie Griefer


...All the world shall be your enemy, Prince with a Thousand Enemies,
and whenever they catch you, they will kill you. But first they must catch
you, digger, listener, runner, prince with a swift warning.
Be cunning and full of tricks and your people shall never be destroyed.

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260397
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Mixing CF and JavaScript.

2006-11-14 Thread Ian Skinner
BTW, just to clarify...I wasn't trying to debate over which was easier (the 
JS array vs AJAX), since easy is a relative term.  My point was that it's 
possible to do without AJAX.

And my easy was referring to the creation of the JS array, again not JS array 
VS AJAX.  But I concur that jumping into AJAX your first week of using CF may 
be a bit much to ask a novice.  Especially if one is coming from a procedural 
background rather then an Object Orientated.  


--
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

-
| 1 |   |
-  Binary Soduko
|   |   |
-
 
C code. C code run. Run code run. Please!
- Cynthia Dunning

Confidentiality Notice:  This message including any
attachments is for the sole use of the intended
recipient(s) and may contain confidential and privileged
information. Any unauthorized review, use, disclosure or
distribution is prohibited. If you are not the
intended recipient, please contact the sender and
delete any copies of this message. 




~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260399
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


RE: Mixing CF and JavaScript.

2006-11-14 Thread Munson, Jacob
 You can do exactly what he wants by loading the data into a JS array.
 Then his function would simply look in the array rather than trying to
 do a query.
 
 the cfquery in his function is querying for a specific record based on
 a value passed to the function.
 
 if he does a query without the WHERE and loops over that query, he can
 create a JS array easily.

Oh, I see what you mean.  I stand corrected.  :)

That would work, as long as you're not dealing with a lot of records.
Well, it would still work, but you'd potentially be sending the poor
user megabytes of data in your page.  ;)



--
This transmission may contain information that is privileged, confidential 
and/or exempt from disclosure under applicable law. If you are not the intended 
recipient, you are hereby notified that any disclosure, copying, distribution, 
or use of the information contained herein (including any reliance thereon) is 
STRICTLY PROHIBITED. If you received this transmission in error, please 
immediately contact the sender and destroy the material in its entirety, 
whether in electronic or hard copy format. Thank you. 

==
EMF idahopower.com made the previous annotations.

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260403
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Mixing CF and JavaScript.

2006-11-14 Thread Dan Plesse
I reviewed every one's response so far and I did like a single one. I would
use a bakery analogy. For example CF is like a cake it gets baked first then
the sweet buttery javascript icing goes last. The two don't mix well. To cut
the layers you need a fork called AJAX  bla bla bla. What you need to do is
change things around and make Javascript into a cake too and CF the cake
next to your new js cake of pure icing. When people eat your cake they dream
of eating the CF cake. Those wishfull day dreams are called HXMLHttpRequest
bla bla bla because JS longs to be a reasonable cake.


~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260430
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Mixing CF and JavaScript.

2006-11-14 Thread Charlie Griefer
I think for a guy who's on day 5...all that analogy is going to do is
make him more confused and hungry for cake.

On 11/14/06, Dan Plesse [EMAIL PROTECTED] wrote:
 I reviewed every one's response so far and I did like a single one. I would
 use a bakery analogy. For example CF is like a cake it gets baked first then
 the sweet buttery javascript icing goes last. The two don't mix well. To cut
 the layers you need a fork called AJAX  bla bla bla. What you need to do is
 change things around and make Javascript into a cake too and CF the cake
 next to your new js cake of pure icing. When people eat your cake they dream
 of eating the CF cake. Those wishfull day dreams are called HXMLHttpRequest
 bla bla bla because JS longs to be a reasonable cake.


 

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260431
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Mixing CF and JavaScript.

2006-11-14 Thread Dan Vega
Im on year 5 and I am hungry for cake!

On 11/14/06, Charlie Griefer [EMAIL PROTECTED] wrote:

 I think for a guy who's on day 5...all that analogy is going to do is
 make him more confused and hungry for cake.

 On 11/14/06, Dan Plesse [EMAIL PROTECTED] wrote:
  I reviewed every one's response so far and I did like a single one. I
 would
  use a bakery analogy. For example CF is like a cake it gets baked first
 then
  the sweet buttery javascript icing goes last. The two don't mix well. To
 cut
  the layers you need a fork called AJAX  bla bla bla. What you need to do
 is
  change things around and make Javascript into a cake too and CF the cake
  next to your new js cake of pure icing. When people eat your cake they
 dream
  of eating the CF cake. Those wishfull day dreams are called
 HXMLHttpRequest
  bla bla bla because JS longs to be a reasonable cake.
 
 
 

 

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260433
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4


Re: Mixing CF and JavaScript.

2006-11-14 Thread Jon Clausen
To cake or not to bake, that is the question...
Whether 'tis nobler in the kitchen to suffer the slings and arrows of  
outrageous icing or to bear arms against a sea of debugging - and by  
opposing, to make a sandwich...

- Will Bakespeare


-Jon*needs to eat some dinner*


On Nov 14, 2006, at 7:00 PM, Dan Vega wrote:

 Im on year 5 and I am hungry for cake!

 On 11/14/06, Charlie Griefer [EMAIL PROTECTED] wrote:

 I think for a guy who's on day 5...all that analogy is going to do is
 make him more confused and hungry for cake.

 On 11/14/06, Dan Plesse [EMAIL PROTECTED] wrote:
 I reviewed every one's response so far and I did like a single  
 one. I
 would
 use a bakery analogy. For example CF is like a cake it gets baked  
 first
 then
 the sweet buttery javascript icing goes last. The two don't mix  
 well. To
 cut
 the layers you need a fork called AJAX  bla bla bla. What you  
 need to do
 is
 change things around and make Javascript into a cake too and CF  
 the cake
 next to your new js cake of pure icing. When people eat your cake  
 they
 dream
 of eating the CF cake. Those wishfull day dreams are called
 HXMLHttpRequest
 bla bla bla because JS longs to be a reasonable cake.






 

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260436
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: Mixing CF and JavaScript.

2006-11-14 Thread Richard Dillman
Heres my .02

Do an iframe with the variable in the Url of the iframe.
Do an onblur event on the field to reload the iframe.
Put your Query and Display element in the iframe.

I say this because if your doing a query on a DB with millions of records an
aray might not be a good idea.?

I use that approach for my data entry people for Addresses on the Zip Code
to get County Contact info.




On 11/14/06, Charlie Griefer [EMAIL PROTECTED] wrote:

 I think for a guy who's on day 5...all that analogy is going to do is
 make him more confused and hungry for cake.

 On 11/14/06, Dan Plesse [EMAIL PROTECTED] wrote:
  I reviewed every one's response so far and I did like a single one. I
 would
  use a bakery analogy. For example CF is like a cake it gets baked first
 then
  the sweet buttery javascript icing goes last. The two don't mix well. To
 cut
  the layers you need a fork called AJAX  bla bla bla. What you need to do
 is
  change things around and make Javascript into a cake too and CF the cake
  next to your new js cake of pure icing. When people eat your cake they
 dream
  of eating the CF cake. Those wishfull day dreams are called
 HXMLHttpRequest
  bla bla bla because JS longs to be a reasonable cake.
 
 
 

 

~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:260437
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4