RE: Javascript and Coldfusion

2008-08-03 Thread Jim Davis
> -Original Message-
> From: Jenny Gavin-Wear [mailto:[EMAIL PROTECTED]
> Sent: Saturday, August 02, 2008 2:12 AM
> To: CF-Talk
> Subject: Javascript and Coldfusion
> 
> I'm looking for some good advice/info on exchanging variables between
> CF and
> javascript, anyone know of a good reference site, please?

That's a very (VERY) big question.  ;^)

There are many ways to accomplish this, from the relatively simple to the
incredibly complex.  What system you might use is really up to personal
preference and your needs.

Before any of this you really need to understand (and maybe you already do,
so ignore the next bit) the data flow involved, the paths of information and
so forth.

A normal transaction ("getting a web page") might look like this:

1) User clicks a ColdFusion link in a browser which submits a request.  This
request might contain URL (GET) or Form (POST) variables.  It would also
contain any cookie variables related to the domain.

2) The web server gets the request (at this point it may actually change it,
but usually doesn't) and gives it to ColdFusion to process.

3) ColdFusion processes it.  It can use the variables that might be
contained in the request and access any domain cookies.  It can also store
information "permanently" in many ways (but usually in the Session scope).

4) ColdFusion generates a response - usually an HTML page although using the
CFCONTENT tag it can return any type of date (images, flash objects, style
sheets, etc).  It can also generate (but not run) JavaScript (technically
any client-side script).

5) ColdFusion gives the response back to the web server - it's done with
this request.  The web server has the option of changing it here (usually to
add universal information like CPP cookies or for performance reasons, like
compressing the return).

6) The web server gives the response back to the browser - it's done with
this request.  The browser parses the result and displays the results.  If
the return is an HTML page or Javascript file the browser will run that
script.

Any script could in turn create, access or manipulate GET or POST variables
or cookies.  It could itself initiate a request to a new ColdFusion page
(without the user needing to do anything) and the whole process starts
again.

There are a few point here related to your question:

1) Both CF and JavaScript can access and use GET, POST and Cookie variables
- but not at the same time.

2) A single JavaScript can make MANY requests to ColdFusion, but a
ColdFusion page can only respond once.  In short this means that a single
web page might have a continuing conversation with ColdFusion but each
exchange must be done via a new ColdFusion page.

3) To maintain information across a conversation you need to store
information state.  In both CF and JavaScipt this can be done using Cookies.
In CF you have many options (Session, Server and Application scopes,
database, etc) while in JavaScript you're more limited.  JavaScript can, of
course, store information within itself, as local variables (for this reason
it's usually easiest for one script to make multiple requests to ColdFusion)
but you might also store information in another script maintained in a
"permanent" location like a frame.

So...


By far the simplest way to trade information between CF and JS is the basic,
standard request.  The page is displayed, JS can modify information, the
user clicks a link or submits a form and CF see the data.  This is the way
99% of the web works - click, response, click, response.

I'm almost certain what you're talking about however is passing information
between JS and CF without refreshing the page - without the user's needing
to make a specific action.

I think the most straight-forward way to do this is by using images and
cookies.  This is a very old technique - dating back to at least 2000 - but
it still works just fine for small pieces of information.

The basic idea is that JavaScript adds information to an image URL then
calls to change that image.  Instead of calling an image directly however it
calls a CF file which uses the information, puts a response in a cookie and
then sends the originally requested image.  JavaScript can then read the
cookie to get the response.

I wrote an article about this in late 2000 but several people came up with
the idea independently about the same time.  The article's old, but it still
holds up pretty well:

http://www.depressedpress.com/Content/Development/JavaScript/Articles/GIFAsP
ipe/Index.cfm

Today most of this kind of functionality falls under the sadly named "AJAX"
umbrella.  This nearly also involves using a relatively recent piece of
browser functionality called "XMLHTTPRequest" which allows JavaScript
running in a browser to make direct HTTP requests to the server the current
page was delivered from.

There are many, many (MANY) resources dealing with AJAX.  There are also a
large number of abstraction libraries available which make working with it
e

RE: Any legal issue saving some CC info?

2008-08-03 Thread Justin D. Scott
> I was wondering if there are any legal issues
> saving the last 4 digits and expiry dates of a
> CC as part of a transaction?  Should they be
> encrypted?

See the PCI-DSS (Payment Card Industry Data Security Standards).  There are
a lot of contractual regulations that have to be met if you're processing
credit card transactions.  

https://www.pcisecuritystandards.org/
https://www.pcisecuritystandards.org/security_standards/pci_dss.shtml
http://en.wikipedia.org/wiki/PCI_DSS


-Justin Scott


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

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


SOT: Any legal issue saving some CC info?

2008-08-03 Thread Victor Moore
Hi,

I was wondering if there are any legal issues saving the last 4 digits and
expiry dates of a CC as part of a transaction?
Should they be encrypted?

Thank you
Victor


~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

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


Re: Reloading CFC's?

2008-08-03 Thread Greg Morphis
When creating and testing my CFCs I usually set my applicationtimeout
to 1 minute, that seems to work well for me for this very same
problem.

On Sun, Aug 3, 2008 at 10:14 AM, James Holmes <[EMAIL PROTECTED]> wrote:
> Is the CFC in the application scope? If so, you need to have some way
> of re-creating it in that scope.
>
> The restart you just did will have done this. It's better to do it
> programatically.
>
> On Sun, Aug 3, 2008 at 11:10 PM, Phillip M. Vector
> <[EMAIL PROTECTED]> wrote:
>> Strange. I unchecked it (thanks) and it's still doing it. I even cleared
>> the cache. I'll restart the service and see if that helps.
>
> --
> mxAjax / CFAjax docs and other useful articles:
> http://www.bifrost.com.au/blog/
>
> 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

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


Re: Reloading CFC's?

2008-08-03 Thread James Holmes
Is the CFC in the application scope? If so, you need to have some way
of re-creating it in that scope.

The restart you just did will have done this. It's better to do it
programatically.

On Sun, Aug 3, 2008 at 11:10 PM, Phillip M. Vector
<[EMAIL PROTECTED]> wrote:
> Strange. I unchecked it (thanks) and it's still doing it. I even cleared
> the cache. I'll restart the service and see if that helps.

-- 
mxAjax / CFAjax docs and other useful articles:
http://www.bifrost.com.au/blog/

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

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


Re: Reloading CFC's?

2008-08-03 Thread Phillip M. Vector
and that did it. Thanks Cutter. :)

Phillip M. Vector wrote:
> Strange. I unchecked it (thanks) and it's still doing it. I even cleared 
> the cache. I'll restart the service and see if that helps.
> 
> Cutter (CFRelated) wrote:
>> Philip,
>>
>> I had the same problem, until I notice that "Save Class Files" was 
>> checked in the 'Caching' section of the CF Administrator.

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

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


Re: Reloading CFC's?

2008-08-03 Thread Phillip M. Vector
Strange. I unchecked it (thanks) and it's still doing it. I even cleared 
the cache. I'll restart the service and see if that helps.

Cutter (CFRelated) wrote:
> Philip,
> 
> I had the same problem, until I notice that "Save Class Files" was 
> checked in the 'Caching' section of the CF Administrator.
> 
> Steve "Cutter" Blades
> Adobe Certified Professional
> Advanced Macromedia ColdFusion MX 7 Developer
> _
> http://blog.cutterscrossing.com
> 
> Phillip M. Vector wrote:
>> Do CFC's have to be "reloaded"?
>>
>> I just put in a function into a cfc and when I try to load it up, it says...
>>
>> " The method testing was not found in component 
>> C:\Webpages\CurrentProjects\Blisuptown\cfcs\ezsite.cfc.
>> Ensure that the method is defined, and that it is spelled correctly. "
>>
>> I'm positive it's spelled correctly (cut and paste) and the code is just 
>> a copy of the code in another cffunction (I didn't make the changes to 
>> it yet).
>>
>> So my question is why isn't it recognizing the code in the CFC that I 
>> know is there? Do I need to restart the CF server every time I make a 
>> change to a cfc?
>>
>>
> 
> 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

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


Re: Reloading CFC's?

2008-08-03 Thread Cutter (CFRelated)
Philip,

I had the same problem, until I notice that "Save Class Files" was 
checked in the 'Caching' section of the CF Administrator.

Steve "Cutter" Blades
Adobe Certified Professional
Advanced Macromedia ColdFusion MX 7 Developer
_
http://blog.cutterscrossing.com

Phillip M. Vector wrote:
> Do CFC's have to be "reloaded"?
> 
> I just put in a function into a cfc and when I try to load it up, it says...
> 
> " The method testing was not found in component 
> C:\Webpages\CurrentProjects\Blisuptown\cfcs\ezsite.cfc.
> Ensure that the method is defined, and that it is spelled correctly. "
> 
> I'm positive it's spelled correctly (cut and paste) and the code is just 
> a copy of the code in another cffunction (I didn't make the changes to 
> it yet).
> 
> So my question is why isn't it recognizing the code in the CFC that I 
> know is there? Do I need to restart the CF server every time I make a 
> change to a cfc?
> 
> 

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

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


Reloading CFC's?

2008-08-03 Thread Phillip M. Vector
Do CFC's have to be "reloaded"?

I just put in a function into a cfc and when I try to load it up, it says...

" The method testing was not found in component 
C:\Webpages\CurrentProjects\Blisuptown\cfcs\ezsite.cfc.
Ensure that the method is defined, and that it is spelled correctly. "

I'm positive it's spelled correctly (cut and paste) and the code is just 
a copy of the code in another cffunction (I didn't make the changes to 
it yet).

So my question is why isn't it recognizing the code in the CFC that I 
know is there? Do I need to restart the CF server every time I make a 
change to a cfc?

~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

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